Package org.exolab.castor.jdo

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


       
        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


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

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

        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

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

        LOG.debug("Test OQL query");
        _db.begin();
        oql = _db.getOQLQuery("SELECT master FROM " + MasterKeyGen.class.getName()
                + " master WHERE master.details.value1=$1");
        oql.bind(Detail.DEFAULT_VALUE);
        qres = oql.execute();
        if (qres.hasMore()) {
            LOG.debug("OK: correct result of query 1 ");
        } else {
            LOG.error("incorrect result of query 1 ");
            fail("incorrect result of query 1");
View Full Code Here

                    + "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");
View Full Code Here

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

        _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 {
View Full Code Here

        }
        oql.close();
        oql = _db.getOQLQuery("SELECT master FROM " + MasterKeyGen.class.getName()
                + " master WHERE master.details.details2.value1=$1");
        oql.bind(DetailKeyGen2.DEFAULT_VALUE);
        qres = oql.execute();
        if (qres.hasMore()) {
            LOG.debug("OK: correct result of query 3 ");
        } else {
            LOG.error("incorrect result of query 3 ");
            fail("incorrect result of query 3");
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.