Package org.datanucleus.query.expression

Examples of org.datanucleus.query.expression.JoinExpression


        SQLTable sqlTbl = candSqlTbl;
        while (rightExpr != null)
        {
            if (rightExpr instanceof JoinExpression)
            {
                JoinExpression joinExpr = (JoinExpression)rightExpr;
                JoinType joinType = joinExpr.getType();
                String joinAlias = joinExpr.getAlias();
                PrimaryExpression joinPrimExpr = joinExpr.getPrimaryExpression();

                Iterator<String> iter = joinPrimExpr.getTuples().iterator();
                String rootId = iter.next();
                String joinTableGroupName = null;
                if (rootId.equalsIgnoreCase(candidateAlias))
View Full Code Here


                    }

                    Attribute attr = join.getAttribute();
                    tuples.add(attr.getName());
                    PrimaryExpression primExpr = new PrimaryExpression(new ArrayList(tuples));
                    JoinExpression joinExpr = new JoinExpression(primExpr, join.getAlias(), jt);
                    if (currentExpr instanceof ClassExpression)
                    {
                        ((ClassExpression)currentExpr).setJoinExpression(joinExpr);
                    }
                    else
                    {
                        ((JoinExpression)currentExpr).setJoinExpression(joinExpr);
                    }

                    currentExpr = joinExpr;
                }
            }

            if (fetchJoins != null && !fetchJoins.isEmpty())
            {
                List tuples = new ArrayList();
                tuples.add(getAlias());

                Iterator<Fetch<X, ?>> iter = fetchJoins.iterator();
                Expression currentExpr = expr;
                while (iter.hasNext())
                {
                    Fetch<X, ?> join = iter.next();
                    org.datanucleus.query.expression.JoinExpression.JoinType jt = org.datanucleus.query.expression.JoinExpression.JoinType.JOIN_INNER;
                    if (join.getJoinType() == JoinType.LEFT)
                    {
                        jt = org.datanucleus.query.expression.JoinExpression.JoinType.JOIN_LEFT_OUTER;
                    }
                    else if (join.getJoinType() == JoinType.RIGHT)
                    {
                        jt = org.datanucleus.query.expression.JoinExpression.JoinType.JOIN_RIGHT_OUTER;
                    }

                    Attribute attr = join.getAttribute();
                    tuples.add(attr.getName());
                    PrimaryExpression primExpr = new PrimaryExpression(new ArrayList(tuples));
                    JoinExpression joinExpr = new JoinExpression(primExpr, null, jt);
                    if (currentExpr instanceof ClassExpression)
                    {
                        ((ClassExpression)currentExpr).setJoinExpression(joinExpr);
                    }
                    else
View Full Code Here

    return (keysOnly ? ResultType.KEYS_ONLY : ResultType.ENTITY);
  }

  private void processFromExpression(QueryData qd, Expression expr) {
    if (expr instanceof JoinExpression) {
      JoinExpression joinExpr = (JoinExpression) expr;
      if (joinExpr.getType() != JoinExpression.JoinType.JOIN_INNER &&
          joinExpr.getType() != JoinExpression.JoinType.JOIN_INNER_FETCH) {
        throw new UnsupportedDatastoreFeatureException("Cannot fulfill outer join queries.");
      }
      qd.joinOrderExpression = createJoinOrderExpression(joinExpr.getPrimaryExpression());
    }
    if (expr.getLeft() != null) {
      processFromExpression(qd, expr.getLeft());
    }
    if (expr.getRight() != null) {
View Full Code Here

  }


  private void processFromExpression(QueryData qd, Expression expr) {
    if (expr instanceof JoinExpression) {
      JoinExpression joinExpr = (JoinExpression) expr;
      if (joinExpr.getType() != JoinExpression.JoinType.JOIN_INNER &&
          joinExpr.getType() != JoinExpression.JoinType.JOIN_INNER_FETCH) {
        throw new UnsupportedDatastoreFeatureException("Cannot fulfill outer join queries.");
      }
      qd.joinOrderExpression = createJoinOrderExpression(joinExpr.getPrimaryExpression());
    }
    if (expr.getLeft() != null) {
      processFromExpression(qd, expr.getLeft());
    }
    if (expr.getRight() != null) {
View Full Code Here

  }


  private void processFromExpression(QueryData qd, Expression expr) {
    if (expr instanceof JoinExpression) {
      JoinExpression joinExpr = (JoinExpression) expr;
      if (joinExpr.getType() != JoinExpression.JoinType.JOIN_INNER &&
          joinExpr.getType() != JoinExpression.JoinType.JOIN_INNER_FETCH) {
        throw new UnsupportedDatastoreFeatureException("Cannot fulfill outer join queries.");
      }
      qd.joinOrderExpression = createJoinOrderExpression(joinExpr.getPrimaryExpression());
    }
    if (expr.getLeft() != null) {
      processFromExpression(qd, expr.getLeft());
    }
    if (expr.getRight() != null) {
View Full Code Here

  }


  private void processFromExpression(QueryData qd, Expression expr) {
    if (expr instanceof JoinExpression) {
      JoinExpression joinExpr = (JoinExpression) expr;
      if (joinExpr.getType() != JoinExpression.JoinType.JOIN_INNER &&
          joinExpr.getType() != JoinExpression.JoinType.JOIN_INNER_FETCH) {
        throw new UnsupportedDatastoreFeatureException("Cannot fulfill outer join queries.");
      }
      qd.joinOrderExpression = createJoinOrderExpression(joinExpr.getPrimaryExpression());
    }
    if (expr.getLeft() != null) {
      processFromExpression(qd, expr.getLeft());
    }
    if (expr.getRight() != null) {
View Full Code Here

TOP

Related Classes of org.datanucleus.query.expression.JoinExpression

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.