Examples of newOQLQuery()


Examples of org.odmg.Implementation.newOQLQuery()

            tx.begin();
            tx.lock(site, Transaction.WRITE);
            tx.commit();

            /* Retrieve from the object created, and set the year*/
            OQLQuery query = odmg.newOQLQuery();
            query.create(queryString);
            query.bind(name);

            tx.begin();
            List result = (List) query.execute();
View Full Code Here

Examples of org.odmg.Implementation.newOQLQuery()

            site.setYear(new Integer(2003));

            tx.commit();

            /* Flush the cache, and retrieve the object again */
            query = odmg.newOQLQuery();
            query.create(queryString);
            query.bind(name);
            tx.begin();
            ((HasBroker) tx).getBroker().clearCache();
            result = (List) query.execute();
View Full Code Here

Examples of org.odmg.Implementation.newOQLQuery()

        }
        tx.commit();

        tx.begin();
        // query test objects
        OQLQuery q = odmg.newOQLQuery();
        q.create("select all from "+DListObject.class.getName()+" where name=$1");
        q.bind(name);
        Collection ret = (Collection) q.execute();
        // check result list size
        assertEquals(5, ret.size());
View Full Code Here

Examples of org.odmg.Implementation.newOQLQuery()

        db.open(databaseName, Database.OPEN_READ_ONLY);
        Transaction tx = odmg.newTransaction();
        tx.begin();
        for (int i = 0; i < articleCount; i++)
        {
            OQLQuery query = odmg.newOQLQuery();
            String sql = "select allArticles from " + PerformanceArticle.class.getName() + " where articleId=" + i;
            query.create(sql);
            query.execute();
        }
        tx.commit();
View Full Code Here

Examples of org.odmg.Implementation.newOQLQuery()

        broker.close();

        Implementation odmg = OJB.getInstance();
        Database db = odmg.newDatabase();
        db.open(databaseName, Database.OPEN_READ_WRITE);
        OQLQuery query = odmg.newOQLQuery();
        String sql = "select allArticles from " + PerformanceArticle.class.getName() + " where articleId between " + new Integer(offsetId) + " and " + new Integer(offsetId + articleCount);
        query.create(sql);
        long start = System.currentTimeMillis();
        ManageableCollection collection = (ManageableCollection) query.execute();
        Iterator iter = collection.ojbIterator();
View Full Code Here

Examples of org.odmg.Implementation.newOQLQuery()

            // 3. Get a list of some articles
            Transaction tx = odmg.newTransaction();
            tx.begin();

            OQLQuery query = odmg.newOQLQuery();
            String sql = "select aPerson.firstname, aPerson.lastname from " + org.apache.ojb.broker.Person.class.getName();
            query.create(sql);

            ManageableCollection result = (ManageableCollection) query.execute();
View Full Code Here

Examples of org.odmg.Implementation.newOQLQuery()

                i++;
            }
            if (i < COUNT)
                fail("Should have found at least " + COUNT + " items");

            OQLQuery query1 = odmg.newOQLQuery();
            query1.create("select distinct anArticle.productGroup.groupId from " + Article.class.getName());
            List result1 = (List) query1.execute();
            for (it = result1.iterator(); it.hasNext(); )
            {
                it.next();
View Full Code Here

Examples of org.odmg.Implementation.newOQLQuery()

         /**
         * now make sure they are in db, A first, then B
         */
        tx.begin();
        OQLQuery query = odmg.newOQLQuery();
        int i = 0;
        query.create("select bidirectionalAssociationObjectA from " + BidirectionalAssociationObjectA.class.getName() + " where pk=$1");
        query.bind("A"+currentTime);
        ManageableCollection all = (ManageableCollection) query.execute();
        java.util.Iterator it = all.ojbIterator();
View Full Code Here

Examples of org.odmg.Implementation.newOQLQuery()

                fail("a should have had a related b");
        }
        if (i > 1)
            fail("should have found only one bidirectionalAssociationObjectA, instead found: " + i);

        query = odmg.newOQLQuery();
        i = 0;
        query.create("select bidirectionalAssociationObjectB from " + BidirectionalAssociationObjectB.class.getName() + " where pk=$1");
        query.bind("B"+currentTime);
        all = (ManageableCollection) query.execute();
        it = all.ojbIterator();
View Full Code Here

Examples of org.odmg.Implementation.newOQLQuery()

        /**
         * now make sure they are in db, A first, then B
         */
        tx.begin();
        OQLQuery query = odmg.newOQLQuery();
        int i = 0;
        query.create("select bidirectionalAssociationObjectA from " + BidirectionalAssociationObjectA.class.getName() + " where pk=$1");
        query.bind("A"+currentTime);
         ManageableCollection all = (ManageableCollection) query.execute();
        java.util.Iterator it = all.ojbIterator();
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.