Examples of OQLQuery


Examples of org.exolab.castor.jdo.OQLQuery

        };
       
        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("select computer from "
                + Computer.class.getName() + " as computer order by computer.id");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
            int counter = 1;
            while (results.hasMore()) {
                Computer computer = (Computer) results.next();
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

        _db =  _jdo.getDatabase();
        _db.begin();
       
        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();
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

    /**
     * Tests that modification to read only objects are not persist in the
     * database.
     */
    public void runTest() throws PersistenceException {
        OQLQuery      oql;
        Sample    object;
        Enumeration   enumeration;

        // load an object using readOnly mode
        _db.begin();
       
        oql = _db.getOQLQuery("SELECT object FROM "
                + Sample.class.getName() + " object WHERE id = $1");
        oql.bind(Sample.DEFAULT_ID);
       
        enumeration = oql.execute(Database.READONLY);
        object = (Sample) enumeration.nextElement();
        LOG.debug("Retrieved object: " + object);
        object.setValue1(NEW_VALUE);
        LOG.debug("Modified object: " + object);
       
        _db.commit();
       
        // read the object from another transaction to see
        // if changes is not persisted.
        _db.begin();
       
        oql.bind(Sample.DEFAULT_ID);
        enumeration = oql.execute(Database.READONLY);
        object = (Sample) enumeration.nextElement();
        LOG.debug("Retrieved object: " + object);
        if (object.getValue1().equals(NEW_VALUE)) {
            LOG.error("Error: modified object was stored");
            fail("Modified object was stored");
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

    public void testQueryLaptops () throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("select l from "
                + Laptop.class.getName() + " as l order by l.id");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
            int counter = 1;
            Laptop laptop = null;
            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_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();
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

   
    public void testQueryServers () throws Exception {
        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();
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

        _db =  _jdo.getDatabase();
        _db.begin();
       
        long begin = System.currentTimeMillis();
       
        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();
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_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();
View Full Code Here

Examples of org.exolab.castor.jdo.OQLQuery

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

Examples of org.odmg.OQLQuery

        // 1.build complete OQL statement
        String oql = "select all from java.lang.Object where " + predicate;
        TransactionImpl tx = getTransaction();
        if (tx == null) throw new QueryInvalidException("Need running transaction to do query");

        OQLQuery predicateQuery = tx.getImplementation().newOQLQuery();
        predicateQuery.create(oql);
        Query pQ = ((OQLQueryImpl) predicateQuery).getQuery();
        Criteria pCrit = pQ.getCriteria();

        PBCapsule handle = new PBCapsule(pbKey, tx);
        DList result;
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.