Package org.odmg

Examples of org.odmg.OQLQuery.execute()


        tx.begin();
        tx.getBroker().clearCache();
        query = odmg.newOQLQuery();
        query.create(queryGat);
        query.bind(gat.getGatId());
        result = (Collection) query.execute();
        assertEquals("Wrong number of objects found", 1, result.size());
        fetchedGat = (Gatherer) result.iterator().next();
        colC = fetchedGat.getCollectiblesC();
        assertEquals("Wrong number of CollectiblesA found in Gatherer", 4, colC.size());
        tx.commit();
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 " + CollectibleB.class.getName() +
                " where name like $1");
        query.bind(prefix + "%");
        result = (Collection) query.execute();
        assertEquals("Wrong number of objects found", 4, result.size());
        tx.commit();

        // check if the gatherer now contains a CollectibleBase list
        // increased by the added
View Full Code Here

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

        OQLQuery query = impl.newOQLQuery();

        query.create("select products from " + Product.class.getName() + " where name = $1");
        query.bind(name);

        DList   results = (DList)query.execute();
        Product product = (Product)results.iterator().next();

        tx.commit();
        return product;
    }
View Full Code Here

            // 3. set the OQL select statement
            query.create("select allproducts from " + Product.class.getName());

            // 4. perform the query and store the result in a persistent Collection
            DList allProducts = (DList) query.execute();

            tx.commit();

            // 5. now iterate over the result to print each product
            for (Iterator iter = allProducts.iterator(); iter.hasNext();)
View Full Code Here

            // Check stored objects
            OQLQuery query = odmg.newOQLQuery();
            query.create("select masters from " + Master.class.getName() + " where masterText like $1");
            query.bind("%" + timestamp);
            DList allMasters = (DList) query.execute();
            assertEquals("We should found master objects", 2, allMasters.size());
            Master lookup_1 = (Master) allMasters.get(0);

            Collection col_in = lookup_1.getCollDetailFKinPK();
            Collection col_no = lookup_1.getCollDetailFKnoPK();
View Full Code Here

            // Check stored objects
            OQLQuery query = odmg.newOQLQuery();
            query.create("select masters from " + Master.class.getName() + " where masterText like $1");
            query.bind("%" + timestamp);
            DList allMasters = (DList) query.execute();
            assertEquals("We should found master objects", 2, allMasters.size());
            Master lookup_1 = (Master) allMasters.get(0);
            Collection col_in = lookup_1.getCollDetailFKinPK();
            Collection col_no = lookup_1.getCollDetailFKnoPK();
            assertEquals("Should found none " + DetailFKnoPK.class.getName() + " objects", 0, col_no.size());
View Full Code Here

            tx.begin();
            OQLQuery query = odmg.newOQLQuery();
            query.create("select masters from " + Master.class.getName() + " where masterText like $1");
            query.bind("%" + timestamp);
            DList allMasters = (DList) query.execute();

            // Iterator over all Master objects
            Iterator it = allMasters.iterator();
            int counter = 0;
            while (it.hasNext())
View Full Code Here

            assertEquals("Wrong count of Master objects found", 4, counter);

            query = odmg.newOQLQuery();
            query.create("select masters from " + Master.class.getName() + " where masterText like $1");
            query.bind("%" + timestamp);
            allMasters = (DList) query.execute();
            assertEquals("Delete of Master objects failed", 0, allMasters.size());

            database.close();
        }
        finally
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.