// Use same java type as the argument
SQLExpression argExpr = (SQLExpression)args.get(0);
m = getMappingForClass(argExpr.getJavaTypeMapping().getJavaType());
if (args.get(0) instanceof TemporalExpression)
{
return new AggregateTemporalExpression(stmt, m, getFunctionName(), args);
}
else
{
return new AggregateNumericExpression(stmt, m, getFunctionName(), args);
}