resultDefinition.addMappingForResultExpression(i, idx);
}
else if (resultExprs[i] instanceof CreatorExpression)
{
processCreatorExpression((CreatorExpression)resultExprs[i]);
NewObjectExpression sqlExpr = (NewObjectExpression)stack.pop();
StatementNewObjectMapping stmtMap = getStatementMappingForNewObjectExpression(sqlExpr);
resultDefinition.addMappingForResultExpression(i, stmtMap);
}
else if (resultExprs[i] instanceof DyadicExpression)
{
// Something like {a+b} perhaps. Maybe we should check for invalid expressions?
resultExprs[i].evaluate(this);
SQLExpression sqlExpr = stack.pop();
int[] cols = stmt.select(sqlExpr, alias);
StatementMappingIndex idx = new StatementMappingIndex(sqlExpr.getJavaTypeMapping());
idx.setColumnPositions(cols);
if (alias != null)
{
idx.setColumnAlias(alias);
}
resultDefinition.addMappingForResultExpression(i, idx);
}
else if (resultExprs[i] instanceof CaseExpression)
{
resultExprs[i].evaluate(this);
SQLExpression sqlExpr = stack.pop();
int[] cols = stmt.select(sqlExpr, alias);
StatementMappingIndex idx = new StatementMappingIndex(sqlExpr.getJavaTypeMapping());
idx.setColumnPositions(cols);
if (alias != null)
{
idx.setColumnAlias(alias);
}