Package org.molgenis.framework.db

Examples of org.molgenis.framework.db.SubQueryRule


                QueryRule[] nestedrules = rule.getNestedRules();
                predicate = _createWhere(db, mapper, em, root, cq, cb, new int[2], joinHash,
                    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
                // come)
                String fieldForSubQuery = sqr.getJpaAttribute();

                if (sqr.getSubQueryOperator().equals(Operator.IN))
                {
                  predicate = cb.in(root.get(fieldForSubQuery)).value(sq);
                }
                else
                {
View Full Code Here

TOP

Related Classes of org.molgenis.framework.db.SubQueryRule

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.