INTERNAL
Validate node and calculates its type.
super.validate(context);
TypeHelper typeHelper = context.getTypeHelper();
Object leftType = left.getType();
Object rightType = right.getType();
if (typeHelper.isEnumType(leftType) && !typeHelper.isEnumType(rightType)) {
throw EJBQLException.invalidEnumEqualExpression(
context.getQueryInfo(), getLine(), getColumn(),
typeHelper.getTypeName(leftType), typeHelper.getTypeName(rightType));
} else if (typeHelper.isEnumType(rightType) && !typeHelper.isEnumType(leftType)) {
throw EJBQLException.invalidEnumEqualExpression(
context.getQueryInfo(), getLine(), getColumn(),
typeHelper.getTypeName(rightType), typeHelper.getTypeName(leftType));
}
setType(typeHelper.getBooleanType());