Package org.odmg

Examples of org.odmg.Database.lookup()


        Transaction tx = odmg.newTransaction();
        tx.begin();
        try
        {
            db.bind(example, bindingName);
            Article value = (Article) db.lookup(bindingName);
            assertTrue("Could not lookup object for binding name: "+bindingName, value != null);
            tx.commit();
        }
        catch (ObjectNameNotFoundException ex)
        {
View Full Code Here


        db.open(databaseName, Database.OPEN_READ_WRITE);
        Transaction tx = odmg.newTransaction();
        tx.begin();
        db.bind(odmg.newDList(), bindingName);

        foundList = (DList)db.lookup(bindingName);
        assertTrue("Could not found bound DList", foundList != null);
        foundList = null;

        db.unbind(bindingName);
        try
View Full Code Here

        foundList = null;

        db.unbind(bindingName);
        try
        {
            foundList = (DList) db.lookup(bindingName);
            fail("Found unbound DList");
        }
        catch (ObjectNameNotFoundException ex)
        {
        }
View Full Code Here

        }

        db.bind(odmg.newDList(), bindingName);
        try
        {
            foundList = (DList) db.lookup(bindingName);
        }
        catch (ObjectNameNotFoundException ex)
        {
            fail("Could not found bound DList, binding name was: "+bindingName);
        }
View Full Code Here

        tx = odmg.newTransaction();
        tx.begin();
        try
        {
            DList newList = (DList)db.lookup(bindingName);
            db.unbind(bindingName);
        }
        catch (ObjectNameNotFoundException ex)
        {
            fail("Could not found bound DList in new tx");
View Full Code Here

        tx.begin();

        try
        {
            // lookup by name binding
            lookedUp1 = (Article) db.lookup(bindingName);
        }
        catch (ObjectNameNotFoundException ex)
        {
            fail("lookup by name: " + bindingName + " should not be unknown");
        }
View Full Code Here

        // 3. check if name is really unknown now
        tx = odmg.newTransaction();
        tx.begin();
        try
        {
            Article value = (Article) db.lookup(name);
        }
        catch (ObjectNameNotFoundException ex)
        {
            // OK !
            tx.commit();
View Full Code Here

            tx.begin();

            ((TransactionImpl) tx).getBroker().clearCache();

            // look it up again
            DList newResults = (DList) db.lookup(name);

            assertEquals(originalSize, newResults.size());
            Article art = (Article) newResults.get(0);
            assertNotNull(art);
//            OJB.getLogger().info(results);
View Full Code Here

            tx.begin();

            ((TransactionImpl) tx).getBroker().clearCache();

            // look it up again
            List newResults = (List) db.lookup(name);

            assertEquals(originalSize, newResults.size());
            Article art = (Article) newResults.get(0);
            assertNotNull(art);
//            OJB.getLogger().info(results);
View Full Code Here

        DList list = odmg.newDList();
        db.bind(list, name);
        tx.commit();
        tx = odmg.newTransaction();
        tx.begin();
        Object obj = db.lookup(name);
        tx.commit();
        assertNotNull("binded DList not found", obj);

        tx = odmg.newTransaction();
        tx.begin();
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.