Examples of OQLQuery


Examples of org.exolab.castor.jdo.OQLQuery

        db.getCacheManager().expireCache();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "SELECT o FROM " + Service.class.getName() + " o order by o.id");
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

        Database db =  _jdo.getDatabase();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "SELECT o FROM " + Service.class.getName() + " o order by o.id");
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

        db.getCacheManager().expireCache();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as ID "
              + "from PTF_SERVICE order by PTF_SERVICE.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

        Database db =  _jdo.getDatabase();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as ID "
              + "from PTF_SERVICE order by PTF_SERVICE.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

        db.getCacheManager().expireCache();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as ID "
              + "from PTF_SERVICE order by PTF_SERVICE.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

        Database db =  _jdo.getDatabase();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as ID "
              + "from PTF_SERVICE order by PTF_SERVICE.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

        Database db =  _jdo.getDatabase();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as ID "
              + "from PTF_SERVICE order by PTF_SERVICE.ID "
              + "AS " + OID.class.getName());
        QueryResults results = query.execute(Database.READONLY);
       
        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

        if (_db.isActive()) { _db.rollback(); }
        _db.close();
    }
   
    private void delete() throws PersistenceException {
        OQLQuery oql;
        QueryResults qres;
        int cnt;

        LOG.debug("Delete everything");
        _db.begin();
        oql = _db.getOQLQuery(
                "SELECT master FROM " + MasterKeyGen.class.getName() + " master");
        qres = oql.execute();

        for (cnt = 0; qres.hasMore(); cnt++) {
            _db.remove(qres.next());
        }
        oql.close();
        LOG.debug("Deleting " + cnt + " master objects");

        oql = _db.getOQLQuery("SELECT group FROM " + Group.class.getName() + " group");
        qres = oql.execute();
        for (cnt = 0; qres.hasMore(); cnt++) {
            _db.remove(qres.nextElement());
        }
        oql.close();
        LOG.debug("Deleting " + cnt + " group objects");
        _db.commit();
    }
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

    public void setUp() throws PersistenceException, SQLException {
        _db = _category.getDatabase();
    }

    public void runTest() throws PersistenceException, SQLException {
        OQLQuery      oql;
        QueryResults  enumeration;
        Entity        object;

        _db.begin();

        // Determine if test object exists, if not create it.
        // If it exists, set the name to some predefined value
        // that this test will later override.
        oql = _db.getOQLQuery(
                "SELECT object FROM " + Entity.class.getName() + " object WHERE id = $1");
        oql.bind(50);
        enumeration = oql.execute();
        if (enumeration.hasMore()) {
            object = (Entity) enumeration.next();
            LOG.debug("Retrieved object: " + object);
            object.setValue1(Entity.DEFAULT_VALUE_1);
            object.setValue2(Entity.DEFAULT_VALUE_2);
        } else {
            object = new Entity();
            object.setId(50);
            LOG.debug("Creating new object: " + object);
            _db.create(object);
        }
        oql.close();
        _db.commit();

        try {
            LOG.debug("CALL SQL query with object part of an extend hierarchy");
            _db.begin();
            oql = _db.getOQLQuery("CALL SQL "
                    + "SELECT tc3x_entity.id,tc3x_entity.value1,tc3x_entity.value2,"
                    + "tc3x_extends.id,tc3x_extends.value3,tc3x_extends.value4 "
                    + "FROM tc3x_entity LEFT OUTER JOIN tc3x_extends "
                    + "ON tc3x_entity.id=tc3x_extends.id "
                    + "WHERE (tc3x_entity.id = $1) AS " + Entity.class.getName());
            oql.bind(50);
            enumeration = oql.execute();
            if (enumeration.hasMore()) {
                object = (Entity) enumeration.next();
                LOG.debug("Retrieved object: " + object);
            } else {
                fail("test object not found");
            }
            oql.close();
            _db.commit();
        } catch (Exception ex) {
            fail("Exception thrown " + ex);
        }

        LOG.debug("CALL SQL query with simple (stand-alone) object");
        _db.begin();
        CallEntity test = new CallEntity();
        test.setId(55);
        test.setValue1("value1");
        test.setValue2("value2");
        _db.create(test);
        _db.commit();
       
        _db.begin();
        oql = _db.getOQLQuery(
                "CALL SQL SELECT id, value1 , value2 "
                + "FROM tc3x_call WHERE (id = $1) AS " + CallEntity.class.getName());
        oql.bind(55);
        enumeration = oql.execute();
        CallEntity objectEx = null;
        if (enumeration.hasMore()) {
            objectEx = (CallEntity) enumeration.next();
            LOG.debug("Retrieved object: " + objectEx);
        } else {
            fail("test object not found");
        }
        oql.close();
        _db.commit();
       
        _db.begin();
        test = (CallEntity) _db.load(CallEntity.class, new Integer(55));
        _db.remove(test);
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

     */
    public void testQuerySortedCollection() throws Exception {
        Database db = _category.getDatabase();
        db.begin();
       
        OQLQuery query = db.getOQLQuery("SELECT c FROM "
                + SortedContainer.class.getName() + " c WHERE id = $1");
        query.bind(new Integer(1));
        QueryResults results = query.execute();
       
        SortedContainer entity = null;
       
        entity = (SortedContainer) results.next();
        assertNotNull(entity);
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.