Examples of TestClassBProxy


Examples of org.apache.ojb.odmg.shared.TestClassBProxy

            tx.begin();

            //create a TestClassBProxy and persist it
            //so that when loading it again we will
            //get a dynamic proxy object
            TestClassBProxy b = new TestClassBProxy();
            new Identity(b,((HasBroker)tx).getBroker());


            tx.lock(b, Transaction.WRITE);
            tx.commit();
            String bOid = b.getOid();

            //reload the object created in the previous step
            tx = odmg.newTransaction();
            tx.begin();
            OQLQuery query = odmg.newOQLQuery();
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassBProxy

            Transaction tx = odmg.newTransaction();
            tx.begin();
            //create a TestClassBProxy and persist it
            //so that when loading it again we will
            //get a dynamic proxy object
            TestClassBProxy b = new TestClassBProxy();
            database.makePersistent(b);
            tx.commit();

            //reload the object created in the previous step
            tx = odmg.newTransaction();
            tx.begin();
            OQLQuery query = odmg.newOQLQuery();
            query.create("select bproxies from " + TestClassBProxy.class.getName() +
            " where oid = $1");
            query.bind(b.getOid());
            List bList = (List) query.execute();
            assertEquals(1, bList.size());

            TestClassBProxyI bI = (TestClassBProxyI) bList.get(0);

            //bI should now be a dynamic proxy
            assertTrue(ProxyHelper.isProxy(bI));

            TestClassAWithBProxy a = new TestClassAWithBProxy();
            a.setBProxy(bI);
            tx.lock(a, Transaction.WRITE);
            tx.commit();

            //on commit the foreign key in "a" should have been set to
            //bOid
            String aBOid = a.getBoid();

            assertEquals("foreign key should match", b.getOid(), aBOid);

        } catch(ODMGException ex) {
          fail("ODMGException" + ex);
        }
    }
View Full Code Here

Examples of org.apache.ojb.odmg.shared.TestClassBProxy

            tx.begin();

            //create a TestClassBProxy and persist it
            //so that when loading it again we will
            //get a dynamic proxy object
            TestClassBProxy b = new TestClassBProxy();
            new Identity(b,((HasBroker)tx).getBroker());


            tx.lock(b, Transaction.WRITE);
            tx.commit();
            String bOid = b.getOid();

            //reload the object created in the previous step
            tx = odmg.newTransaction();
            tx.begin();
            OQLQuery query = odmg.newOQLQuery();
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.