Package org.exolab.castor.jdo

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


        db.begin();
        master = (MasterObject) db.load(MasterObject.class, new Integer(masterId));
        assertNotNull(master.getDepends());
        db.commit();

        db.begin();
        master = (MasterObject) db.load(MasterObject.class, new Integer(
                masterId));
        assertNotNull(master);
        db.remove(master);
        db.commit();
View Full Code Here


        Database db = null;
        MasterObjectNoKeyGen master = new MasterObjectNoKeyGen();
        master.setId(100);
        master.setDescrip("This is the descrip.");
        db = _category.getDatabase();
        db.begin();
        db.create(master);
        db.commit();

        assertTrue(master.getId() != 0);
        assertEquals(100, master.getId());
View Full Code Here

        assertTrue(master.getId() != 0);
        assertEquals(100, master.getId());

        //THIS Part Works!
        db.begin();
        DependentObjectNoKeyGen depends = new DependentObjectNoKeyGen();
        depends.setId(101);
        depends.setDescrip("Description");
        master.setDepends(depends);
        db.update(master);
View Full Code Here

        assertTrue(master.getId() != 0);
        assertEquals(100, master.getId());
        int masterId = master.getId();

        db.begin();
        master = (MasterObjectNoKeyGen) db.load(MasterObjectNoKeyGen.class, new Integer(
                masterId));
        assertNotNull(master.getDepends());
        master.setDepends(null);
        db.commit();
View Full Code Here

                masterId));
        assertNotNull(master.getDepends());
        master.setDepends(null);
        db.commit();

        db.begin();
        master = (MasterObjectNoKeyGen) db.load(MasterObjectNoKeyGen.class, new Integer(
                masterId));
        assertNull(master.getDepends());
        db.commit();
View Full Code Here

                masterId));
        assertNull(master.getDepends());
        db.commit();

        //THIS part doesn't!
        db.begin();
        master = (MasterObjectNoKeyGen) db.load(MasterObjectNoKeyGen.class, new Integer(
                masterId));
        depends = new DependentObjectNoKeyGen();
        depends.setId(102);
        depends.setDescrip("Description");
View Full Code Here

        depends.setId(102);
        depends.setDescrip("Description");
        master.setDepends(depends);
        db.commit();

        db.begin();
        master = (MasterObjectNoKeyGen) db.load(MasterObjectNoKeyGen.class, new Integer(
                masterId));
        assertNotNull(master.getDepends());
        db.commit();
View Full Code Here

        master = (MasterObjectNoKeyGen) db.load(MasterObjectNoKeyGen.class, new Integer(
                masterId));
        assertNotNull(master.getDepends());
        db.commit();

        db.begin();
        master = (MasterObjectNoKeyGen) db.load(MasterObjectNoKeyGen.class, new Integer(
                masterId));
        assertNotNull(master);
        db.remove(master);
        db.commit();
View Full Code Here

    }

    public void testLoadAndUpdateLaptop() throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        Laptop laptop = (Laptop) database.load(Laptop.class, new Integer(1));
        database.commit();
       
        assertNotNull(laptop);
        assertEquals("ctf.jdo.tc9x.Laptop", laptop.getClass().getName());
View Full Code Here

   
    public void testReadWriteOidCached() throws Exception {
        long start = System.currentTimeMillis();
       
        Database db = _jdo.getDatabase();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_LOCKED.ID as ID "
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.