private void processJoin(ExpressionBuilderHelper h, QueryCompilation compilation, FetchPlan fetchPlan, boolean hasWhere) { if (compilation.getExprFrom() == null) return; for (Expression fromExpr : compilation.getExprFrom()) { if (!(fromExpr instanceof ClassExpression)) { throw new NucleusDataStoreException("Unsupported from expression: " + fromExpr); } Expression expr = fromExpr.getRight(); while (expr != null) { if (expr instanceof JoinExpression) { JoinExpression je = (JoinExpression) expr; processJoinExpression(je.getPrimaryExpression(), je.getAlias(), h, compilation, true, hasWhere, false); h.sb.append("))"); // Either this was already true or will be after the first call hasWhere = true; } else { throw new NucleusDataStoreException("Unsupported expression found inside a join expression: " + fromExpr.getRight()); } expr = expr.getRight(); } } }
private void processJoin(ExpressionBuilderHelper h, QueryCompilation compilation, FetchPlan fetchPlan, boolean hasWhere) { if (compilation.getExprFrom() == null) return; for (Expression fromExpr : compilation.getExprFrom()) { if (!(fromExpr instanceof ClassExpression)) { throw new NucleusDataStoreException("Unsupported from expression: " + fromExpr); } Expression expr = fromExpr.getRight(); while (expr != null) { if (expr instanceof JoinExpression) { JoinExpression je = (JoinExpression) expr; processJoinExpression(je.getPrimaryExpression(), je.getAlias(), h, compilation, true, hasWhere, false); h.sb.append("))"); // Either this was already true or will be after the first call hasWhere = true; } else { throw new NucleusDataStoreException("Unsupported expression found inside a join expression: " + fromExpr.getRight()); } expr = expr.getRight(); } } }
Expression joinedExpr = joinExpr.getJoinedExpression(); Expression joinOnExpr = joinExpr.getOnExpression(); String joinAlias = joinExpr.getAlias();