Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.QueryResults


     */
    public final void testSizeB() throws PersistenceException {
        _db.begin();
        OQLQuery oqlquery = _db.getOQLQuery(
                "SELECT object FROM " + Entity.class.getName() + " object");
        QueryResults enumeration = oqlquery.execute(true);
        while (enumeration.hasMore()) {
            enumeration.next();
            assertTrue("size should be > 0", enumeration.size() > 0);
            assertEquals("size should be ==25", enumeration.size(), 25);
        }
        _db.commit();
    }
View Full Code Here


     */
    public final void testSizeC() throws PersistenceException {
        _db.begin();
        OQLQuery oqlquery = _db.getOQLQuery(
                "SELECT object FROM " + Entity.class.getName() + " object");
        QueryResults enumeration = oqlquery.execute(true);
        int expectedSize = enumeration.size();
        int realSize = 0;
        while (enumeration.hasMore()) {
            enumeration.next();
            realSize++;
        }
        _db.commit();
        assertEquals("realsize didn't equal expectedsize", realSize, expectedSize);
    }
View Full Code Here

    protected void testOneKeyGen(final Class objClass, final Class extClass)
    throws Exception {
        OQLQuery oql;
        UuidObject object;
        UuidObject ext;
        QueryResults enumeration;
       
        // Open transaction in order to perform JDO operations
        _db.begin();

        // Create first object
        object = (UuidObject) objClass.newInstance();
        LOG.debug("Creating first object: " + object);
        _db.create(object);
        LOG.debug("Created first object: " + object);

        // Create second object
        ext = (UuidObject) extClass.newInstance();
        LOG.debug("Creating second object: " + ext);
        _db.create(ext);
        LOG.debug("Created second object: " + ext);

        _db.commit();

        _db.begin();

        // Find the first object and remove it
        //object = (TestUuidObject) _db.load( objClass, object.getId() );
        oql = _db.getOQLQuery();
        oql.create("SELECT object FROM " + objClass.getName()
                + " object WHERE id = $1");
        oql.bind(object.getId());
        enumeration = oql.execute();
        LOG.debug("Removing first object: " + object);
        if (enumeration.hasMore()) {
            object = (UuidObject) enumeration.next();
            _db.remove(object);
            LOG.debug("OK: Removed");
        } else {
            LOG.error("first object not found");
            fail("first object not found");
        }

        // Find the second object and remove it
        //ext = (TestUuidObject) _db.load( extClass, ext.getId() );
        oql = _db.getOQLQuery();
        oql.create("SELECT ext FROM " + extClass.getName()
                + " ext WHERE id = $1");
        oql.bind(ext.getId());
        enumeration = oql.execute();
        LOG.debug("Removing second object: " + ext);
        if (enumeration.hasMore()) {
            ext = (UuidObject) enumeration.next();
            _db.remove(ext);
            LOG.debug("OK: Removed");
        } else {
            LOG.error("second object not found");
            fail("second object not found");
View Full Code Here

       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "SELECT o FROM " + Locked.class.getName() + " o order by o.id");
        QueryResults results = query.execute();
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            iterateStates((Locked) results.next());

            count++;
        }
       
        long iterate = System.currentTimeMillis();
View Full Code Here

       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "SELECT o FROM " + Locked.class.getName() + " o order by o.id");
        QueryResults results = query.execute();
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            iterateStates((Locked) results.next());

            count++;
        }
       
        long iterate = System.currentTimeMillis();
View Full Code Here

       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "SELECT o FROM " + Locked.class.getName() + " o order by o.id");
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            iterateStates((Locked) results.next());

            count++;
        }
       
        long iterate = System.currentTimeMillis();
View Full Code Here

       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "SELECT o FROM " + Locked.class.getName() + " o order by o.id");
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            iterateStates((Locked) results.next());

            count++;
        }
       
        long iterate = System.currentTimeMillis();
View Full Code Here

       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_LOCKED.ID as ID "
              + "from PTF_LOCKED order by PTF_LOCKED.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            OID oid = (OID) results.next();
            iterateStates((Locked) db.load(Locked.class, oid.getId()));

            count++;
        }
       
View Full Code Here

       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_LOCKED.ID as ID "
              + "from PTF_LOCKED order by PTF_LOCKED.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            OID oid = (OID) results.next();
            iterateStates((Locked) db.load(Locked.class, oid.getId()));

            count++;
        }
       
View Full Code Here

       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_LOCKED.ID as ID "
              + "from PTF_LOCKED order by PTF_LOCKED.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            OID oid = (OID) results.next();
            iterateStates((Locked) db.load(Locked.class, oid.getId(), Database.READONLY));

            count++;
        }
       
View Full Code Here

TOP

Related Classes of org.exolab.castor.jdo.QueryResults

Copyright © 2018 www.massapicom. 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.