Package org.exolab.castor.jdo

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


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


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

            LOG.debug("OK: correct result of query 1 ");
        } 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 {
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);
View Full Code Here

            LOG.debug("OK: correct result of query 2 ");
        }
        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 ");
View Full Code Here

            LOG.debug("OK: correct result of query 3 ");
        } 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 {
View Full Code Here

            LOG.debug("OK: correct result of query 4 ");
        }
        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 ");
View Full Code Here

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

        _db.commit();
       
        // 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) {
View Full Code Here

        // 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 "
                + 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);
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.