Package org.exolab.castor.jdo

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


            LOG.debug("OK: correct result of query 3 ");
        } else {
            LOG.error("incorrect result of query 3 ");
            fail("incorrect result of query 3");
        }
        oql.bind(Detail2.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 " + Master.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

   
        _db.begin();
       
        OQLQuery query = _db.getOQLQuery("SELECT entity FROM "
                + TransientMaster.class.getName() + " entity WHERE id = $1");
        query.bind(new Integer(1));
        QueryResults results = query.execute();
       
        entity = (TransientMaster) results.next();

        assertNotNull(entity);
View Full Code Here

                "SELECT p FROM " + Product.class.getName() + " p WHERE p.id = $1");

        // If no such products with ids 5-8 exist, create new objects and persist them
        for (int i = 5; i < 10; ++i) {
            int j = i + 1;
            productOql.bind(j);
            results = productOql.execute();
            if (!results.hasMore()) {
                Computer computerToCreate = new Computer();
                computerToCreate.setId(i);
                computerToCreate.setCpu("cpu");
View Full Code Here

        LOG.info("Begin transaction: update extends relation in long transaction");

        OQLQuery computerOql = db.getOQLQuery(
                "SELECT c FROM " + Computer.class.getName() + " c WHERE c.id = $1");

        computerOql.bind(44);
        results = computerOql.execute();
        while (results.hasMore()) {
            computer = new Computer();
            computer = (Computer) results.next();
            LOG.debug("Found existing computer: " + computer);
View Full Code Here

        // Look up the products and if found delete them from the database
        OQLQuery productOql = db.getOQLQuery(
                "SELECT p FROM " + Product.class.getName() + " p WHERE p.id = $1");

        for (int i = 4; i < 10; ++i) {
            productOql.bind(i);
            results = productOql.execute();
            while (results.hasMore())  {
                product = (Product) results.next();
                LOG.debug("Deleting existing product: " + product);
                db.remove(product);
View Full Code Here

                LOG.debug("Deleting existing product: " + product);
                db.remove(product);
            }
        }
       
        productOql.bind(99);
        results = productOql.execute();
        while (results.hasMore())  {
            product = (Product) results.next();
            LOG.debug("Deleting existing product: " + product);
            db.remove(product);
View Full Code Here

       
        // Look up the computer and if found delete them from the database
        OQLQuery computerOql = db.getOQLQuery(
                "SELECT c FROM " + Computer.class.getName() + " c WHERE c.id = $1");
       
        computerOql.bind(44);
        results = computerOql.execute();
        while (results.hasMore())  {
            Computer computerToDelete = (Computer) results.next();
            LOG.debug("Deleting existing computer: " + computerToDelete);
            db.remove(computerToDelete);
View Full Code Here

        // Note: product uses group, so group object has to be created first, but can
        //       be persisted later
        OQLQuery productOql = db.getOQLQuery(
                "SELECT p FROM " + Product.class.getName() + " p WHERE p.id = $1");

        productOql.bind(4);
        results = productOql.execute();
        if (!results.hasMore()) {
            Computer computerToCreate = new Computer();
            computerToCreate.setId(4);
            computerToCreate.setCpu("pentium");
View Full Code Here

        // Note: computer uses group, so group object has to be created first, but can
        //       be persisted later
        OQLQuery computerOql = db.getOQLQuery(
                "SELECT c FROM " + Computer.class.getName() + " c WHERE c.id = $1");

        computerOql.bind(44);
        results = computerOql.execute();
        if (!results.hasMore()) {
            Computer computerToCreate = new Computer();
            computerToCreate.setId(44);
            computerToCreate.setCpu("Pentium");
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.