orderExpr.bind(symtbl);
orderExprs[i++] = orderExpr;
}
}
compilation = new QueryCompilation(candidateClass, candidateAlias, symtbl, resultExprs,
fromExprs, filterExpr, groupingExprs, havingExpr, orderExprs, null);
compilation.setQueryLanguage("JPQL");
}
if (subqueries != null && !subqueries.isEmpty())
{
Iterator<SubqueryImpl<?>> subqueryIter = subqueries.iterator();
while (subqueryIter.hasNext())
{
SubqueryImpl sub = subqueryIter.next();
org.datanucleus.query.expression.Expression subExpr = sub.getQueryExpression();
if (subExpr instanceof SubqueryExpression)
{
SubqueryExpression subqueryExpr = (SubqueryExpression) sub.getQueryExpression();
VariableExpression subqueryVar = (VariableExpression) subqueryExpr.getRight();
CriteriaQueryImpl<T> subDelegate = (CriteriaQueryImpl<T>) sub.getDelegate();
QueryCompilation subCompilation = subDelegate.getCompilation(mmgr, clr, compilation.getSymbolTable());
subCompilation.setQueryLanguage("JPQL");
compilation.addSubqueryCompilation(subqueryVar.getId(), subCompilation);
}
else if (subExpr instanceof VariableExpression)
{
VariableExpression subVarExpr = (VariableExpression)subExpr;
CriteriaQueryImpl<T> subDelegate = (CriteriaQueryImpl<T>) sub.getDelegate();
QueryCompilation subCompilation = subDelegate.getCompilation(mmgr, clr, compilation.getSymbolTable());
subCompilation.setQueryLanguage("JPQL");
compilation.addSubqueryCompilation(subVarExpr.getId(), subCompilation);
}
}
}