Package org.apache.ojb.odmg.oql

Examples of org.apache.ojb.odmg.oql.OQLQueryImpl


     */
    public org.odmg.DCollection query(String predicate) throws org.odmg.QueryInvalidException
    {
        // 1.build complete OQL statement
        String oql = "select all from java.lang.Object where " + predicate;
        OQLQuery predicateQuery = new OQLQueryImpl(pbKey);

        Transaction tx = getTransaction();
        PBCapsule capsule = new PBCapsule(pbKey, 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


    public DCollection query(String predicate) throws QueryInvalidException
    {
        // 1.build complete OQL statement
        String oql = "select all from java.lang.Object where " + predicate;
        /*TODO: Use a ObjectFactory to instantiate OQLQuery? */
        OQLQuery predicateQuery = new OQLQueryImpl(pbKey);
        predicateQuery.create(oql);
        Query pQ = ((OQLQueryImpl) predicateQuery).getQuery();
        Criteria pCrit = pQ.getCriteria();

        Transaction tx = TxManagerFactory.instance().getTransaction();
        if (tx == null) throw new QueryInvalidException("Need running transaction to do query");
View Full Code Here

    {
        if ((getCurrentDatabase() == null) || !getCurrentDatabase().isOpen())
        {
            throw new DatabaseClosedException("Database is not open");
        }
        OQLQueryImpl query = new OQLQueryImpl(this);
        return query;
    }
View Full Code Here

TOP

Related Classes of org.apache.ojb.odmg.oql.OQLQueryImpl

Copyright © 2018 www.massapicom. 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.