Package org.odmg

Examples of org.odmg.OQLQuery.create()


        String oql = "select all from java.lang.Object where " + predicate;
        TransactionImpl tx = getTransaction();
        if (tx == null) throw new QueryInvalidException("Need running transaction to do query");

        OQLQuery predicateQuery = tx.getImplementation().newOQLQuery();
        predicateQuery.create(oql);
        Query pQ = ((OQLQueryImpl) predicateQuery).getQuery();
        Criteria pCrit = pQ.getCriteria();

        PBCapsule handle = new PBCapsule(pbKey, tx);
        DList result;
View Full Code Here


        PBCapsule capsule = new PBCapsule(tx.getImplementation().getCurrentPBKey(), tx);
        PersistenceBroker broker = capsule.getBroker();

        try
        {
            predicateQuery.create(oql);
            Query pQ = ((OQLQueryImpl) predicateQuery).getQuery();
            Criteria pCrit = pQ.getCriteria();

            Criteria allElementsCriteria = this.getPkCriteriaForAllElements(broker);
            // join selection of elements with predicate criteria:
View Full Code Here

        database.deletePersistent(d4);
        tx.commit();

        tx.begin();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select shops from " + Shop.class.getName() + " where name like $1");
        query.bind(name + "%");
        Collection result = (Collection) query.execute();

        assertEquals(2, result.size());
View Full Code Here

        Collection result = (Collection) query.execute();

        assertEquals(2, result.size());

        query = odmg.newOQLQuery();
        query.create("select shops from " + Distributor.class.getName() + " where name like $1");
        query.bind(name + "%");
        result = (Collection) query.execute();

        assertEquals(2, result.size());
        tx.commit();
View Full Code Here

        assertEquals(2, result.size());
        tx.commit();

        tx.begin();
        query = odmg.newOQLQuery();
        query.create("select shops from " + Distributor.class.getName() + " where name like $1");
        query.bind(name + "_3");
        result = (Collection) query.execute();
        tx.commit();

        assertEquals(1, result.size());
View Full Code Here

        database.deletePersistent(d4);
        tx.commit();

        tx.begin();
        OQLQuery query = odmg.newOQLQuery();
        query.create("select shops from " + Shop.class.getName() + " where name like $1");
        query.bind(name + "%");
        Collection result = (Collection) query.execute();

        assertEquals(0, result.size());
View Full Code Here

        Collection result = (Collection) query.execute();

        assertEquals(0, result.size());

        query = odmg.newOQLQuery();
        query.create("select shops from " + Distributor.class.getName() + " where name like $1");
        query.bind(name + "%");
        result = (Collection) query.execute();

        assertEquals(2, result.size());
        tx.commit();
View Full Code Here

        assertEquals(2, result.size());
        tx.commit();

        tx.begin();
        query = odmg.newOQLQuery();
        query.create("select shops from " + Distributor.class.getName() + " where name like $1");
        query.bind(name + "_3");
        result = (Collection) query.execute();
        tx.commit();

        assertEquals(1, result.size());
View Full Code Here

        tx.begin();
        tx.getBroker().clearCache();

        OQLQuery query = odmg.newOQLQuery();
        query.create("select products from " + Shop.class.getName() + " where name like $1");
        query.bind(name + "%");
        Collection result = (Collection) query.execute();
        tx.commit();

        assertEquals(1, result.size());
View Full Code Here


        tx.begin();
        tx.getBroker().clearCache();
        query = odmg.newOQLQuery();
        query.create("select products from " + Product.class.getName() + " where name like $1");
        query.bind(name + "_subPro%");
        result = (Collection) query.execute();
        tx.commit();
        assertEquals(3, result.size());
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.