Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.QueryResults


       
        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();
       
        initIterateQueries();

        int count = 0;
        while (results.hasMore()) {
            iterateStates((Locked) results.next(), Database.READONLY);

            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();
       
        initIterateQueries();

        int count = 0;
        while (results.hasMore()) {
            iterateStates((Locked) results.next(), Database.READONLY);

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

        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("select s from "
                + Server.class.getName() + " as s order by s.id");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
            int counter = 3;
            while (results.hasMore()) {
                Server server = (Server) results.next();
                assertNotNull(server);
                assertEquals(counter, server.getId());
               
                counter += 1;
            }
View Full Code Here

    private void deletePersons() throws PersistenceException {
        _db.begin();
        OQLQuery oqlclean = _db.getOQLQuery("SELECT object FROM "
                + ManyPerson.class.getName() + " object WHERE object.id < $1");
        oqlclean.bind(Integer.MAX_VALUE);
        QueryResults enumeration = oqlclean.execute();
        while (enumeration.hasMore()) {
            _person1 = (ManyPerson) enumeration.next();
            _stream.println("Retrieved object: " + _person1);
            _db.remove(_person1);
            _stream.println("Deleted object: " + _person1);
        }
        _db.commit();
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();
       
        initIterateQueriesOID();

        int count = 0;
        while (results.hasMore()) {
            OID oid = (OID) results.next();
            iterateStatesOID((Locked) _db.load(Locked.class, oid.getId()),
                             Database.SHARED);

            count++;
        }
View Full Code Here

        _db.begin();
        _oql.bind(GROUP_A_ID);
        _groupA = null;
        _person1 = null;
        _person2 = null;
        QueryResults enumeration = _oql.execute();
        if (enumeration.hasMore()) {
            _groupA = (ManyGroup) enumeration.next();
            _stream.println("Retrieved object: " + _groupA);
            Collection p = _groupA.getPeople();
            if (p != null) {
                Iterator itor = p.iterator();
                if (itor.hasNext()) { _person1 = (ManyPerson) itor.next(); }
View Full Code Here

        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("select product from "
                + Product.class.getName() + " as product order by product.id");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
            int counter = 1;
            while (results.hasMore()) {
                Product product = (Product) results.next();
                assertNotNull(product);
                assertEquals(counter, product.getId());
                assertEquals(classNames[counter - 1], product.getClass().getName());
               
                counter += 1;
View Full Code Here

        _db.begin();
        _oql.bind(GROUP_A_ID);
        _groupA = null;
        _person1 = null;
        _person2 = null;
        QueryResults enumeration = _oql.execute();
        if (enumeration.hasMore()) {
            _groupA = (ManyGroup) enumeration.next();
            _stream.println("Retrieved object: " + _groupA);
            Collection p = _groupA.getPeople();
            if (p != null) {
                Iterator itor = p.iterator();
                if (itor.hasNext()) { _person1 = (ManyPerson) itor.next(); }
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();
       
        initIterateQueriesOID();

        int count = 0;
        while (results.hasMore()) {
            OID oid = (OID) results.next();
            iterateStatesOID((Locked) _db.load(Locked.class, oid.getId()),
                             Database.SHARED);

            count++;
        }
View Full Code Here

       
        database.begin();
        OQLQuery query = database.getOQLQuery("SELECT count(laptop.id) FROM "
                + Laptop.class.getName() + " laptop WHERE laptop.resolution = $1");
        query.bind("1024");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
            Object obj = results.next();
            Long count = null;
            if (obj instanceof Long) {
                count = (Long) obj;
            } else if (obj instanceof Integer) {
                count = new Long(((Integer) obj).intValue());
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.