Package org.odmg

Examples of org.odmg.Database.makePersistent()


        BidirectionalAssociationObjectB b = new BidirectionalAssociationObjectB();
        b.setPk("B" + currentTime);

        tx.begin();
        db.makePersistent(a);
        db.makePersistent(b);
        tx.commit();

        tx.begin();
        tx.lock(a, Transaction.WRITE);
        tx.lock(b, Transaction.WRITE);
View Full Code Here


        b.setPk("B" + currentTime);

        tx.begin();
        b.setRelatedA(a);
        a.setRelatedB(b);
        db.makePersistent(a);
        db.makePersistent(b);
        tx.commit();

        /**
         * now make sure they are in db, A first, then B
View Full Code Here

        tx.begin();
        b.setRelatedA(a);
        a.setRelatedB(b);
        db.makePersistent(a);
        db.makePersistent(b);
        tx.commit();

        /**
         * now make sure they are in db, A first, then B
         */
 
View Full Code Here

            ProductGroup pg = new ProductGroup();
            pg.setName("PG A");
            Article example = new Article();
            example.setProductGroup(pg);
            pg.addArticle(example);
            db.makePersistent(pg);

            // modify Object after persist call is allowed
            example.setStock(333);
            example.addToStock(47);
            example.addToStock(7);
View Full Code Here

        try
        {
            Transaction tx = odmg.newTransaction();
            tx.begin();
            Table_1Object table1Ojb = new Table_1Object();
            db.makePersistent(table1Ojb);
            tx.commit();
        }
        finally
        {
            db.close();
View Full Code Here

            Transaction tx = odmg.newTransaction();
            tx.begin();
            Table_1Object table1Obj = new Table_1Object();
            Table_2Object table2Obj = new Table_2Object();
            table1Obj.setTable2Object(table2Obj);
            db.makePersistent(table2Obj);
            db.makePersistent(table1Obj);
            tx.commit();
        }
        finally
        {
View Full Code Here

            tx.begin();
            Table_1Object table1Obj = new Table_1Object();
            Table_2Object table2Obj = new Table_2Object();
            table1Obj.setTable2Object(table2Obj);
            db.makePersistent(table2Obj);
            db.makePersistent(table1Obj);
            tx.commit();
        }
        finally
        {
            db.close();
View Full Code Here

        Database db = odmg.newDatabase();
        db.open(TestHelper.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);

        TransactionExt tx = (TransactionExt) odmg.newTransaction();
        tx.begin();
        db.makePersistent(s_ref_4);
        db.makePersistent(obj_2);
        tx.commit();

        tx.begin();
View Full Code Here

        db.open(TestHelper.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);

        TransactionExt tx = (TransactionExt) odmg.newTransaction();
        tx.begin();
        db.makePersistent(s_ref_4);
        db.makePersistent(obj_2);
        tx.commit();

        tx.begin();

        // try to find object
View Full Code Here

        Database db = odmg.newDatabase();
        db.open(TestHelper.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);

        Transaction tx = odmg.newTransaction();
        tx.begin();
        db.makePersistent(s_ref_1);
        db.makePersistent(s_ref_2);
        db.makePersistent(s_ref_3);
        db.makePersistent(s_ref_4);

        db.makePersistent(obj_1);
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.