Package org.exolab.castor.jdo

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


        // If no such computer exists in the database, create a new
        // object and persist it
        // Note: computer uses group, so group object has to be
        //       created first, but can be persisted later
        computerOql.bind( 44 );
        results = computerOql.execute();

        if ( ! results.hasMore() ) {
            computer = new Computer();
            computer.setId( 44 );
View Full Code Here



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

        computerOql.bind( 44 );
        results = computerOql.execute();

        while ( results.hasMore() )
        {
            computer = new Computer();
View Full Code Here

        db.commit();

        db.begin();
        LOG.info( "Begin transaction: simple load and update within the same transaction" );

        computerOql.bind( 44 );
        results = computerOql.execute();

        if ( results.hasMore() )
        {
            computer = ( Computer ) results.next();
View Full Code Here

        db.commit();

        db.begin();
        LOG.info( "Begin transaction: simple load to test the previous change" );

        computerOql.bind( 44 );
        results = computerOql.execute();

        if ( results.hasMore() )
        {
            LOG.info( "Loaded computer:" + results.next() );
View Full Code Here

        db.begin();
        LOG.info( "Begin transaction: marshalling objects to XML" );

        computerOql = db.getOQLQuery( "SELECT c FROM myapp.Computer c WHERE c.id >= $1" );
        computerOql.bind( 10 );
        results = computerOql.execute();

        while( results.hasMore() )
            marshaller.marshal( results.next() );
View Full Code Here

        // by the rule "read access group".
        // We expect to fetch objects with identities 1,2,3.
        _db.begin();
        oql = _db.getOQLQuery(
                "CALL proc_check_permissions($,$) AS " + Entity.class.getName());
        oql.bind(USER1);
        oql.bind(GROUP1);
        enumeration = oql.execute();

        int resCnt = 0;
        for (int i = 1; enumeration.hasMoreElements(); i++) {
View Full Code Here

        // We expect to fetch objects with identities 1,2,3.
        _db.begin();
        oql = _db.getOQLQuery(
                "CALL proc_check_permissions($,$) AS " + Entity.class.getName());
        oql.bind(USER1);
        oql.bind(GROUP1);
        enumeration = oql.execute();

        int resCnt = 0;
        for (int i = 1; enumeration.hasMoreElements(); i++) {
            object = (Entity) enumeration.nextElement();
View Full Code Here

        LOG.debug("Test OQL query");
        _db.begin();
        oql = _db.getOQLQuery("SELECT master FROM " + Master.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

            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

            LOG.debug("OK: correct result of query 2 ");
        }
        oql.close();
        oql = _db.getOQLQuery("SELECT master FROM " + Master.class.getName()
                + " master WHERE master.details.details2.value1=$1");
        oql.bind(Detail2.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

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.