Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.Database.load()


        database.commit();
       
        database.begin();
        try {
            laptop = (LaptopKeyGen)
                    database.load(LaptopKeyGen.class, new Integer(laptopId));
            fail("Laptop with id " + laptopId + " still exists.");
        } catch (ObjectNotFoundException e) {
            assertTrue("The object of type ctf.jdo.tc9x.Laptop with identity " + laptopId
                     + " was not found in persistent storage", true);
        }
View Full Code Here


    public void testLoadFlat() throws Exception {
        Database db = _jdo.getDatabase();
        assertNotNull(db);
        db.begin();

        Flat flat = (Flat) db.load(Flat.class, new Long(1));

        assertNotNull(flat);
        assertEquals(1, flat.getId());

        db.commit();
View Full Code Here

    public void testLoadHouseOneFlat() throws Exception {
        Database db = _jdo.getDatabase();
        assertNotNull(db);
        db.begin();

        House house = (House) db.load(House.class, new Long(100));
        assertNotNull(house);

        assertEquals(100, house.getId());

        Flat[] flats = house.getFlats();
View Full Code Here

    public void testLoadHouseFlats() throws Exception {
        Database db = _jdo.getDatabase();
        assertNotNull(db);
        db.begin();

        House house = (House) db.load(House.class, new Long(101));
        assertNotNull(house);

        assertEquals(101, house.getId());

        Flat[] flats = house.getFlats();
View Full Code Here

        Lazy1to1Child child = null;
       
        Database db = _category.getDatabase();
       
        db.begin();
        child = (Lazy1to1Child) db.load(Lazy1to1Child.class, new Integer (1));
        parent = new Lazy1to1Parent();
        parent.setId(new Integer(20000));
        parent.setDescription ("parent 20000");
        parent.setChild(child);
        db.create(parent);
View Full Code Here

        parent.setChild(child);
        db.create(parent);
        db.commit();
       
        db.begin();
        parent = (Lazy1to1Parent ) db.load(Lazy1to1Parent.class, new Integer (20000));
        child = parent.getChild();
        assertNotNull(child);
        assertEquals(1, child.getId().intValue());
        db.rollback();
       
View Full Code Here

        assertNotNull(child);
        assertEquals(1, child.getId().intValue());
        db.rollback();
       
        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (20000));
        db.remove(parent);
        db.commit();
       
        db.close();
    }
View Full Code Here

        Lazy1to1Child child = null;

        Database db = _category.getDatabase();

        db.begin();
        child = (Lazy1to1Child) db.load(Lazy1to1Child.class, new Integer (1));
        assertChild(child, 1, "child 1");
        db.commit();
       
        db.close();
    }
View Full Code Here

        Lazy1to1Child child = null;

        Database db = _category.getDatabase();

        db.begin();
        child = (Lazy1to1Child) db.load(Lazy1to1Child.class, new Integer (1),
                                        AccessMode.ReadOnly);
        assertChild(child, 1, "child 1");
        db.commit();
       
        db.close();
View Full Code Here

        Lazy1to1Parent parent = null;
       
        Database db = _category.getDatabase();
       
        db.begin();
        parent = (Lazy1to1Parent) db.load(Lazy1to1Parent.class, new Integer (5));
        assertParent(parent, 5, "parent 5");
        assertNull(parent.getChild());
        db.commit();
       
        db.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.