Examples of Subquery


Examples of javax.persistence.criteria.Subquery

                    nestedrules);
                break;
              case SUBQUERY:
                SubQueryRule sqr = (SubQueryRule) rule;

                Subquery sq = cq.subquery(sqr.getSubQueryResultClass());
                Root<IN> sqFrom = sq.from(sqr.getSubQueryFromClass());

                Mapper<IN> sqMapper = db.getMapper(sqr.getSubQueryFromClass().getName());

                Predicate where = _createWhere(db, sqMapper, em, sqFrom, cq, cb, new int[2], joinHash,
                    (QueryRule[]) sqr.getValue());
                sq.select(sqFrom.get(sqr.getSubQueryAttributeJpa())).where(where);

                // the operator of subquery should be handled in
                // the right way such that no code duplication
                // should occure
                // for the moment only in will work (more to
View Full Code Here

Examples of jcascalog.Subquery

import jcascalog.op.Multiply;


public class Examples {
  public static void twentyFiveYearOlds() {
    Api.execute(new StdoutTap(), new Subquery("?person").predicate(Playground.AGE, "?person", 25));
  }
View Full Code Here

Examples of jcascalog.Subquery

  public static void twentyFiveYearOlds() {
    Api.execute(new StdoutTap(), new Subquery("?person").predicate(Playground.AGE, "?person", 25));
  }

  public static void lessThanThirtyYearsOld() {
    Api.execute(new StdoutTap(), new Subquery("?person")
        .predicate(Playground.AGE, "?person", "?age").predicate(new LT(), "?age", 30));
  }
View Full Code Here

Examples of jcascalog.Subquery

    Api.execute(new StdoutTap(), new Subquery("?person")
        .predicate(Playground.AGE, "?person", "?age").predicate(new LT(), "?age", 30));
  }

  public static void lessThanThirtyYearsOldWithAge() {
    Api.execute(new StdoutTap(), new Subquery("?person", "?age")
        .predicate(Playground.AGE, "?person", "?age").predicate(new LT(), "?age", 30));
  }
View Full Code Here

Examples of jcascalog.Subquery

    Api.execute(new StdoutTap(), new Subquery("?person", "?age")
        .predicate(Playground.AGE, "?person", "?age").predicate(new LT(), "?age", 30));
  }

  public static void doubleAges() {
    Api.execute(new StdoutTap(), new Subquery("?person", "?double-age")
        .predicate(Playground.AGE, "?person", "?age").predicate(new Multiply(), "?age", 2)
        .out("?double-age"));
  }
View Full Code Here

Examples of jcascalog.Subquery

        .predicate(Playground.AGE, "?person", "?age").predicate(new Multiply(), "?age", 2)
        .out("?double-age"));
  }

  public static void distinctPeopleFromFollows() {
    Api.execute(new StdoutTap(), new Subquery("?person")
        .predicate(Playground.FOLLOWS, "?person", "_").predicate(Option.DISTINCT, true));
  }
View Full Code Here

Examples of jcascalog.Subquery

    Api.execute(new StdoutTap(), new Subquery("?person")
        .predicate(Playground.FOLLOWS, "?person", "_").predicate(Option.DISTINCT, true));
  }

  public static void nonDistinctPeopleFromFollows() {
    Api.execute(new StdoutTap(), new Subquery("?person")
        .predicate(Playground.FOLLOWS, "?person", "_"));
  }
View Full Code Here

Examples of jcascalog.Subquery

    Api.execute(new StdoutTap(), new Subquery("?person")
        .predicate(Playground.FOLLOWS, "?person", "_"));
  }

  public static void malePeopleEmilyFollows() {
    Api.execute(new StdoutTap(), new Subquery("?person")
        .predicate(Playground.FOLLOWS, "emily", "?person")
        .predicate(Playground.GENDER, "?person", "m"));
  }
View Full Code Here

Examples of org.apache.openjpa.kernel.exps.Subquery

        // parse the subquery
        ParsedJPQL parsed = new ParsedJPQL(node.parser.jpql, node);

        ClassMetaData candidate = getCandidateMetaData(node);
        Subquery subq = factory.newSubquery(candidate, subclasses, alias);
        subq.setMetaData(candidate);

        contexts.push(new Context(parsed, subq));

        try {
            QueryExpressions subexp = getQueryExpressions();
            subq.setQueryExpressions(subexp);
            return subq;
        } finally {
            // remove the subquery parse context
            contexts.pop();
        }
View Full Code Here

Examples of org.apache.openjpa.kernel.exps.Subquery

            candidate = fmd.getDefiningMetaData();

        setCandidate(candidate, alias);

        Context subContext = ctx();
        Subquery subquery = ctx().getSubquery();
        if (subquery == null){
            subquery = factory.newSubquery(candidate, true, alias);
            subContext.setSubquery(subquery);
        }
        else {
            subquery.setSubqAlias(alias);
        }

        Path subpath = factory.newPath(subquery);
        subpath.setSchemaAlias(path.getCorrelationVar());
        subpath.setMetaData(candidate);
        subquery.setMetaData(candidate);
        if (fmd.isElementCollection())
            exp = and(exp, bindVar);
        else
            exp = and(exp, factory.equal(path, subpath));
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.