Package org.objectweb.medor.query.lib

Examples of org.objectweb.medor.query.lib.SelectProject


        }
       
        EJBQLVariableVisitor eqvv = new EJBQLVariableVisitor(node);
        Map fields = eqvv.getFields();
       
        SelectProject sp = new SelectProject("");
        /*
        // Begin PREFETCHING CODE (by Seb)
        if (mDesc.getPrefetch() && (mapper != null)) {
            // Find the QueryTree of the ClassExtend of the bean of the current finder method
            // WARNING: This only works for finder methods, and not for ejbSelect methods!!!
View Full Code Here


        // first tree of them without collection navigation
        Map fields = sqvv.getFields();
        QueryBuilder qb = sqvv.getQueryBuilder();
        QueryTree qt = sqvv.getQueryTree();

        SelectProject sp = new SelectProject("");
        if (!filter.equals("(true)") && !filter.equals("true")) {
            //Ther is a filter and potentialy collection navigation
            if (debug) {
                logger.log(BasicLevel.DEBUG, "filter = " + qd.filter);
            }
            // start the query filter visitor, to build and expression tree of
            // the filter expression
            SpeedoQLQueryFilterVisitor sqfv = new SpeedoQLQueryFilterVisitor(
                    fields, sp, (ASTSpeedoQL) node,
                    filterParserLogger, hparams, hvars,
                    qd.candidateClass,
                    qb, jf);
            sp.setQueryFilter(sqfv.getQueryFilter());
        }
        assignMapper(sp);
        assignMapper(qt);

        SelectGroupByVisitor sgv = new SelectGroupByVisitor(sp, qt, sqvv, classLoader);
View Full Code Here

        // first tree of them without collection navigation
        Map fields = sqvv.getFields();
        QueryBuilder qb = sqvv.getQueryBuilder();
        QueryTree qt = sqvv.getQueryTree();

        SelectProject sp = new SelectProject("");
        if (!filter.equals("(true)") && !filter.equals("true")) {
            //Ther is a filter and potentialy collection navigation
            if (debug) {
                logger.log(BasicLevel.DEBUG, "filter = " + qd.filter);
            }
            // start the query filter visitor, to build and expression tree of
            // the filter expression
            SpeedoQLQueryFilterVisitor sqfv = new SpeedoQLQueryFilterVisitor(
                    fields, sp, (ASTSpeedoQL) node,
                    filterParserLogger, hparams, hvars,
                    qd.candidateClass,
                    qb, jf);
            sp.setQueryFilter(sqfv.getQueryFilter());
        }
        assignMapper(sp);
        assignMapper(qt);

    JDOQueryEvalContext qec = new JDOQueryEvalContext(sp, this);
   
    SelectGroupByVisitor sgv = new SelectGroupByVisitor(
            sp, qt, mapper, sqvv, qec, classLoader);
   
    sgv.visit(qd);
    selectedFieldTypes = sgv.getSelectFieldTypes();
        assignMapper(qec.query);
   
    //Specify the ordering
        if (qd.order != null && qd.order.size() > 0) {
      OrderField[] ofs = new OrderField[qd.order.size()];
      for(int i=0; i<ofs.length; i++) {
        String o = (String) qd.order.get(i);
        int idx = o.indexOf(' ');
        boolean desc = false;
        if (idx != -1) {
          desc = o.substring(idx + 1).trim().equals("descending");
          o = o.substring(0, idx);
        }
        o = "this." + o;
        ofs[i] = new BasicOrderField((QueryTreeField)
          qt.getTupleStructure().getField(o), desc);
      }
      sp.setOrderBy(ofs);
    }

    logger.log(BasicLevel.INFO, "QueryTree built");
        if (debug) {
            QueryTreePrinter.printQueryTree(qec.query, logger);
        }
    //check for the use of the userCache
        if (qd.result == null && qd.variables == null) {
            //no variable used and the result is the candidate class
            Map field2value = new HashMap();
            if (getFieldComparaison(sp.getQueryFilter(), field2value)) {
                HomeItf sh = null;
                try {
                    sh = (HomeItf) jf.getPClassMapping(
                            qd.candidateClass.getName(),
                            classLoader);
View Full Code Here

TOP

Related Classes of org.objectweb.medor.query.lib.SelectProject

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.