/** * INTERNAL * Validate the current node and calculates its type. */ public void validate(ParseTreeContext context) { Object leftType = null; TypeHelper typeHelper = context.getTypeHelper(); if (left != null) { left.validate(context); // check to see if the argument is a parameter if (isListParameterOrSubquery && !getTheObjects().isEmpty() && ((Node)getTheObjects().get(0)).isParameterNode()){ leftType = Collection.class; } else { leftType = left.getType(); } } for (Iterator i = getTheObjects().iterator(); i.hasNext();) { Node node = (Node)i.next(); node.validate(context); node.validateParameter(context, leftType); Object nodeType = node.getType(); if ((leftType != null) && !typeHelper.isAssignableFrom(leftType, nodeType)) throw JPQLException.invalidExpressionArgument( context.getQueryInfo(), node.getLine(), node.getColumn(), "IN", node.getAsString(), typeHelper.getTypeName(leftType)); } setType(typeHelper.getBooleanType()); }
/** * INTERNAL * Validate the current node and calculates its type. */ public void validate(ParseTreeContext context) { Object leftType = null; TypeHelper typeHelper = context.getTypeHelper(); if (left != null) { left.validate(context); // check to see if the argument is a parameter if (isListParameterOrSubquery && !getTheObjects().isEmpty() && ((Node)getTheObjects().get(0)).isParameterNode()){ leftType = Collection.class; } else { leftType = left.getType(); } } for (Iterator i = getTheObjects().iterator(); i.hasNext();) { Node node = (Node)i.next(); node.validate(context); node.validateParameter(context, leftType); Object nodeType = node.getType(); if ((leftType != null) && !typeHelper.isAssignableFrom(leftType, nodeType)) throw JPQLException.invalidExpressionArgument( context.getQueryInfo(), node.getLine(), node.getColumn(), "IN", node.getAsString(), typeHelper.getTypeName(leftType)); } setType(typeHelper.getBooleanType()); }
/** * INTERNAL * Validate the current node and calculates its type. */ public void validate(ParseTreeContext context) { Object leftType = null; TypeHelper typeHelper = context.getTypeHelper(); if (left != null) { left.validate(context); // check to see if the argument is a parameter if (isListParameterOrSubquery && !getTheObjects().isEmpty() && ((Node)getTheObjects().get(0)).isParameterNode()){ leftType = Collection.class; } else { leftType = left.getType(); } } for (Iterator i = getTheObjects().iterator(); i.hasNext();) { Node node = (Node)i.next(); node.validate(context); node.validateParameter(context, leftType); Object nodeType = node.getType(); if ((leftType != null) && !typeHelper.isAssignableFrom(leftType, nodeType)) throw JPQLException.invalidExpressionArgument( context.getQueryInfo(), node.getLine(), node.getColumn(), "IN", node.getAsString(), typeHelper.getTypeName(leftType)); } setType(typeHelper.getBooleanType()); }