protected void validateBinaryOperatorTypes(final BinaryExpression binaryExpression) throws ExpressionParserException, ExpressionParserInternalError { InfoBinaryOperator binOpt = availableBinaryOperators.get(binaryExpression.getOperator().toUriLiteral()); List<EdmType> actualParameterTypes = new ArrayList<EdmType>(); EdmType operand = binaryExpression.getLeftOperand().getEdmType(); if ((operand == null) && (resourceEntityType == null)) { return; } actualParameterTypes.add(operand); operand = binaryExpression.getRightOperand().getEdmType(); if ((operand == null) && (resourceEntityType == null)) { return; } actualParameterTypes.add(operand); ParameterSet parameterSet = binOpt.validateParameterSet(actualParameterTypes); if (parameterSet == null) { BinaryExpressionImpl binaryExpressionImpl = (BinaryExpressionImpl) binaryExpression; // Tested with TestParserExceptions.TestPMvalidateBinaryOperator throw FilterParserExceptionImpl.createINVALID_TYPES_FOR_BINARY_OPERATOR(binaryExpression.getOperator(), binaryExpression.getLeftOperand().getEdmType(), binaryExpression.getRightOperand().getEdmType(), binaryExpressionImpl.getToken(), curExpression); } binaryExpression.setEdmType(parameterSet.getReturnType()); }
final String right = evaluateExpression(data, binaryExpression.getRightOperand()); switch (binaryExpression.getOperator()) { case ADD: if (binaryExpression.getEdmType() == EdmSimpleTypeKind.Decimal.getEdmSimpleTypeInstance()
final String right = evaluateExpression(data, binaryExpression.getRightOperand()); switch (binaryExpression.getOperator()) { case ADD: if (binaryExpression.getEdmType() == EdmSimpleTypeKind.Decimal.getEdmSimpleTypeInstance()
final String right = evaluateExpression(data, binaryExpression.getRightOperand()); switch (binaryExpression.getOperator()) { case ADD: if (binaryExpression.getEdmType() == EdmSimpleTypeKind.Decimal.getEdmSimpleTypeInstance()
protected void validateBinaryOperatorTypes(final BinaryExpression binaryExpression) throws ExpressionParserException, ExpressionParserInternalError { InfoBinaryOperator binOpt = availableBinaryOperators.get(binaryExpression.getOperator().toUriLiteral()); throw FilterParserExceptionImpl.createINVALID_TYPES_FOR_BINARY_OPERATOR(binaryExpression.getOperator(), binaryExpression.getLeftOperand().getEdmType(), binaryExpression.getRightOperand().getEdmType(), binaryExpressionImpl.getToken(), curExpression);
operator = ((MethodExpression) binaryExpression.getLeftOperand()).getMethod(); if (operator != null && ((binaryExpression.getOperator() == BinaryOperator.EQ) || (binaryExpression.getOperator() == BinaryOperator.NE))) { if (operator == MethodOperator.SUBSTRINGOF) { methodFlag.set(1); if (!binaryExpression.getOperator().equals(BinaryOperator.EQ) && !(binaryExpression.getRightOperand() instanceof LiteralExpression) && ("true".equals(right) || "false".equals(right))) { reInitializePositionalParameters(); throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.OPERATOR_EQ_NE_MISSING .addContent(binaryExpression.getOperator().toString()), null); } else if (binaryExpression.getOperator().equals(BinaryOperator.EQ)) { if ("false".equals(right)) { return JPQLStatement.DELIMITER.PARENTHESIS_LEFT + left.replaceFirst("LIKE", "NOT LIKE") switch (binaryExpression.getOperator()) { case AND: return JPQLStatement.DELIMITER.PARENTHESIS_LEFT + left + JPQLStatement.DELIMITER.SPACE
protected void validateBinaryOperatorTypes(final BinaryExpression binaryExpression) throws ExpressionParserException, ExpressionParserInternalError { InfoBinaryOperator binOpt = availableBinaryOperators.get(binaryExpression.getOperator().toUriLiteral()); throw FilterParserExceptionImpl.createINVALID_TYPES_FOR_BINARY_OPERATOR(binaryExpression.getOperator(), binaryExpression.getLeftOperand().getEdmType(), binaryExpression.getRightOperand().getEdmType(), binaryExpressionImpl.getToken(), curExpression);
operator = ((MethodExpression) binaryExpression.getLeftOperand()).getMethod(); if (operator != null && ((binaryExpression.getOperator() == BinaryOperator.EQ) || (binaryExpression.getOperator() == BinaryOperator.NE))) { if (operator == MethodOperator.SUBSTRINGOF) { methodFlag.set(1); if (!binaryExpression.getOperator().equals(BinaryOperator.EQ) && !(binaryExpression.getRightOperand() instanceof LiteralExpression) && ("true".equals(right) || "false".equals(right))) { reInitializePositionalParameters(); throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.OPERATOR_EQ_NE_MISSING .addContent(binaryExpression.getOperator().toString()), null); } else if (binaryExpression.getOperator().equals(BinaryOperator.EQ)) { if ("false".equals(right)) { return JPQLStatement.DELIMITER.PARENTHESIS_LEFT + left.replaceFirst("LIKE", "NOT LIKE") switch (binaryExpression.getOperator()) { case AND: return JPQLStatement.DELIMITER.PARENTHESIS_LEFT + left + JPQLStatement.DELIMITER.SPACE