Package org.odmg

Examples of org.odmg.OQLQuery.execute()


        tx.flush();

        query = odmg.newOQLQuery();
        query.create("select detail from " + ShopDetail.class.getName() + " where name like $1");
        query.bind(name);
        result = (Collection) query.execute();
        tx.commit();
        assertEquals(1, result.size());

        tx.begin();
        database.deletePersistent(sdNew);
View Full Code Here


        tx.flush();

        query = odmg.newOQLQuery();
        query.create("select detail from " + Shop.class.getName() + " where name like $1");
        query.bind(name);
        result = (Collection) query.execute();
        assertEquals(0, result.size());
        tx.commit();
    }

    public void testOneToOneWithBackReference_2() throws Exception
View Full Code Here

        tx.getBroker().clearCache();

        OQLQuery query = odmg.newOQLQuery();
        query.create("select detail from " + ShopDetail.class.getName() + " where name like $1");
        query.bind(name);
        Collection result = (Collection) query.execute();
        tx.commit();

        assertEquals(1, result.size());
        ShopDetail sdNew = (ShopDetail) result.iterator().next();
        assertNotNull(sdNew.getShop());
View Full Code Here

        tx.flush();

        query = odmg.newOQLQuery();
        query.create("select detail from " + ShopDetail.class.getName() + " where name like $1");
        query.bind(name);
        result = (Collection) query.execute();
        tx.commit();
        assertEquals(0, result.size());

        tx.begin();
        query = odmg.newOQLQuery();
View Full Code Here

        tx.begin();
        query = odmg.newOQLQuery();
        query.create("select detail from " + Shop.class.getName() + " where name like $1");
        query.bind(name);
        result = (Collection) query.execute();
        assertEquals(0, result.size());
        tx.commit();
    }

    public static class Shop
View Full Code Here

        tx.begin();
        // query test objects
        OQLQuery q = odmg.newOQLQuery();
        q.create("select all from "+DObject.class.getName()+" where name=$1");
        q.bind(name);
        Collection ret = (Collection) q.execute();
        // check result list size
        assertEquals(5, ret.size());
        // do read lock
        for (Iterator it = ret.iterator(); it.hasNext(); )
        {
View Full Code Here

        tx.getBroker().clearCache();
        assertNotNull(gat.getGatId());
        OQLQuery query = odmg.newOQLQuery();
        query.create(queryGat);
        query.bind(gat.getGatId());
        Collection result = (Collection) query.execute();
        tx.commit();
        assertEquals("Wrong number of objects found", 1, result.size());
        gat = (Gatherer) result.iterator().next();
        assertNotNull(gat);
        //**********************************************
 
View Full Code Here

        tx.getBroker().clearCache();
        assertNotNull(gat.getGatId());
        query = odmg.newOQLQuery();
        query.create(queryGat);
        query.bind(gat.getGatId());
        result = (Collection) query.execute();
        tx.commit();
        assertEquals("Wrong number of objects found", 1, result.size());
        gat = (Gatherer) result.iterator().next();
        assertNotNull(gat);
        assertNotNull(gat.getCollectiblesC());
View Full Code Here

        OQLQuery query = odmg.newOQLQuery();
        query.create(queryGat);
        query.bind(gat.getGatId());

        Collection result = (Collection) query.execute();
        tx.commit();
        assertEquals("Wrong number of objects found", 1, result.size());
        Gatherer fetchedGat = (Gatherer) result.iterator().next();
        assertNotNull(fetchedGat);
View Full Code Here

        query = odmg.newOQLQuery();
        query.create("select colls from " + CollectibleC.class.getName() +
                " where name like $1");
        query.bind(prefix + "%");
        result = (Collection) query.execute();

        assertEquals("Wrong number of objects found", 2, result.size());
        tx.commit();

        // check if the gatherer now contains a CollectibleBase list
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.