|| sig.equals(MethodChecker.streamJoin);
}
@Override public JPQLQuery<?> virtualMethodCallValue(MethodCallValue.VirtualMethodCallValue val, SymbExPassDown in) throws TypedValueVisitorException
{
MethodSignature sig = val.getSignature();
if (MetamodelUtil.inQueryStream.equals(sig))
{
return handleInQueryStreamSource(val.base, val.args.get(0));
}
else if (isStreamMethod(sig))
{
SymbExPassDown passdown = SymbExPassDown.with(val, false);
// Check out what stream we're aggregating
JPQLQuery<?> subQuery = val.base.visit(this, passdown);
// Extract the lambda used
LambdaAnalysis lambda = null;
if (val.args.size() > 0)
{
if (!(val.args.get(0) instanceof LambdaFactory))
throw new TypedValueVisitorException("Expecting a lambda factory for aggregate method");
LambdaFactory lambdaFactory = (LambdaFactory)val.args.get(0);
try {
lambda = LambdaAnalysis.analyzeMethod(config.metamodel, config.alternateClassLoader, config.isObjectEqualsSafe,
lambdaFactory.getLambdaMethod(), lambdaFactory.getCapturedArgs(), true);
} catch (Exception e)
{
throw new TypedValueVisitorException("Could not analyze the lambda code", e);
}
}
try {
JPQLQuery<?> transformedQuery;
if (sig.equals(MethodChecker.streamDistinct))
{
DistinctTransform transform = new DistinctTransform(config);
transformedQuery = transform.apply(subQuery, argHandler);
}
else if (sig.equals(MethodChecker.streamSelect))
{
SelectTransform transform = new SelectTransform(config, false);
transformedQuery = transform.apply(subQuery, lambda, argHandler);
}
else if (sig.equals(MethodChecker.streamWhere))
{
WhereTransform transform = new WhereTransform(config, false);
transformedQuery = transform.apply(subQuery, lambda, argHandler);
}
else if (sig.equals(MethodChecker.streamJoin))
{
JoinTransform transform = new JoinTransform(config, false);
transformedQuery = transform.apply(subQuery, lambda, argHandler);
}
else