INTERNAL
Validate node and calculate its type.
TypeHelper typeHelper = context.getTypeHelper();
if (left != null) {
left.validate(context);
left.validateParameter(context, typeHelper.getIntType());
Object type = left.getType();
if (!typeHelper.isIntegralType(type))
throw EJBQLException.invalidFunctionArgument(
context.getQueryInfo(), left.getLine(), left.getColumn(),
"MOD", left.getAsString(), "integral type");
}
if (denominator != null) {
denominator.validate(context);
denominator.validateParameter(context, typeHelper.getIntType());
Object denominatorType = denominator.getType();
if (!typeHelper.isIntegralType(denominatorType))
throw EJBQLException.invalidFunctionArgument(
context.getQueryInfo(), denominator.getLine(), denominator.getColumn(),
"MOD", denominator.getAsString(), "integral type");
}
setType(typeHelper.getIntType());