Examples of QueryTree


Examples of org.objectweb.medor.query.api.QueryTree

                qd.candidateClass.getName(), qd.includeSubClasses);
        // start the variable visitor to catch all variables and build a
        // 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) {
View Full Code Here

Examples of org.objectweb.medor.query.api.QueryTree

            rules.add(new Jorm2Rdb());
            rules.add(new Like2SQL());
        } else {

        }
        QueryTree optimizedQT = qt;
        QueryTransformer queryTransformer = new BasicQueryRewriter(rules);
        IndexesGenerator indexesGenerator = new IndexesGenerator();
        try {
            optimizedQT = queryTransformer.transform(optimizedQT);
            if (debug) {
View Full Code Here

Examples of org.objectweb.medor.query.api.QueryTree

                qd.candidateClass.getName(), qd.includeSubClasses);
        // start the variable visitor to catch all variables and build a
        // 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");
View Full Code Here

Examples of org.objectweb.medor.query.api.QueryTree

     * @throws org.objectweb.medor.api.MedorException if corresponding fielc does not exist
     */
    protected Field getMedorFieldFromPath(String path, Map ids)
            throws MedorException, ParseException {
        String[] paths = splitPath(path);
        QueryTree qt = (QueryTree) ids.get(paths[0]);

        if (paths.length > 2)
            throw new Error("recursive path not implemented: " + path);
        if (qt == null) {
            throw new ParseException("Undeclared identification variable " + paths[0] + " in path " + path);
        }
        return qt.getTupleStructure().getField(path);
    }
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.