Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.OQLQuery.execute()


        } else {
            LOG.error("incorrect result of query 3 ");
            fail("incorrect result of query 3");
        }
        oql.bind(DetailKeyGen2.DEFAULT_VALUE + "*");
        qres = oql.execute();
        if (qres.hasMore()) {
            LOG.error("incorrect result of query 4 ");
            fail("incorrect result of query 4");
        } else {
            LOG.debug("OK: correct result of query 4 ");
View Full Code Here


        }
        oql.close();
        oql = _db.getOQLQuery("SELECT master FROM " + MasterKeyGen.class.getName()
                + " master WHERE master.group=$1");
        oql.bind(Group.DEFAULT_ID);
        qres = oql.execute();
        if (qres.hasMore()) {
            LOG.debug("OK: correct result of query 5 ");
        } else {
            LOG.error("incorrect result of query 5 ");
            fail("incorrect result of query 5");
View Full Code Here

        // that this test will later override.
        oql = _db.getOQLQuery("SELECT object FROM "
                + Sample.class.getName() + " object WHERE id = $1");
        oql.bind(Sample.DEFAULT_ID);

        enumeration = oql.execute();
        if (enumeration.hasMore()) {
            object = (Sample) enumeration.next();
            LOG.debug("Retrieved object: " + object);
            object.setValue1(Sample.DEFAULT_VALUE_1);
            object.setValue2(Sample.DEFAULT_VALUE_2);
View Full Code Here

       
        // Open a new transaction in order to conduct test
        _db.begin();
       
        oql.bind(new Integer(Sample.DEFAULT_ID));
        object = (Sample) oql.execute(accessMode).nextElement();
        object.setValue1(JDO_VALUE);
       
        // Perform direct JDBC access and override the value of that table
        if (accessMode != Database.DBLOCKED) {
            _conn.createStatement().execute(
View Full Code Here

        // that this test will later override.
        oql = _db.getOQLQuery("SELECT object FROM "
                + Sample.class.getName() + " object WHERE id = $1");
        oql.bind(Sample.DEFAULT_ID);
       
        enumeration = oql.execute();
        if (enumeration.hasMore()) {
            object = (Sample) enumeration.next();
            LOG.debug("Retrieved object: " + object);
            object.setValue1(Sample.DEFAULT_VALUE_1);
            object.setValue2(Sample.DEFAULT_VALUE_2);
View Full Code Here

        // Open a new transaction in order to conduct test
        _db.begin();
       
        oql.bind(new Integer(Sample.DEFAULT_ID));
        object = (Sample) oql.execute(accessMode).nextElement();
        object.setValue2(JDO_VALUE);
       
        // Perform direct JDBC access and override the value of that table
        if (accessMode != Database.DBLOCKED) {
            _conn.createStatement().execute(
View Full Code Here

                + Entity.class.getName() + " t order by id limit $1 offset $2");

        query.bind(LIMIT);
        query.bind(OFFSET);

        QueryResults results = query.execute();
        assertNotNull (results);
        // size() not available using an Oracle DB assertEquals (LIMIT, results.size());
        for (int i = 1 + OFFSET; i <= OFFSET + LIMIT; i++) {
            Entity testObject = (Entity) results.next();
            assertEquals(i, testObject.getId());
View Full Code Here

    public final void testLimit() throws PersistenceException {
        _db.begin();
        OQLQuery query = _db.getOQLQuery(
                "select t from " + Entity.class.getName() + " t order by id limit $1");
        query.bind(LIMIT);
        QueryResults results = query.execute();
        assertNotNull(results);
        // size() not available using an Oracle DB assertEquals (LIMIT, results.size());
        for (int i = 1; i <= LIMIT; i++) {
            Entity testObject = (Entity) results.next();
            assertEquals(i, testObject.getId());
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();
       
        initIterateQueries();
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();
       
        initIterateQueries();
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.