Package org.odmg

Examples of org.odmg.OQLQuery.create()


        tx.begin();
        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());
View Full Code Here


        // check if the Collectibles were really deleted from DB
        tx.begin();
        tx.getBroker().clearCache();

        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", 4, result.size());
        tx.commit();
View Full Code Here

        // check if the gatherer now contains a CollectibleBase list
        // increased by the added
        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();
View Full Code Here

        tx.begin();
        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());
View Full Code Here

        // check
        tx.begin();
        tx.getBroker().clearCache();

        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();
View Full Code Here

        // check if the gatherer now contains a CollectibleBase list
        // increased by the added
        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();
View Full Code Here

        tx.begin();

        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();
View Full Code Here

            conn = kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey());
            tx   = kit.getTransaction(conn);

            OQLQuery oql = conn.newOQLQuery();

            oql.create(query);

            if (queryParams != null)
            {
                for (int idx = 0; idx < queryParams.length; ++idx)
                {
View Full Code Here

            // 2. get an OQLQuery object from the ODMG facade
            OQLQuery query = odmg.newOQLQuery();

            // 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();
View Full Code Here

            database.makePersistent(master_2);
            tx.commit();

            // 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);
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.