/** * {@inheritDoc} */ @Override public void visit(LikeExpression expression) { expression.getStringExpression().accept(this); StateObject stringStateObject = stateObject; expression.getPatternValue().accept(this); StateObject patternValue = stateObject; LikeExpressionStateObject stateObject = new LikeExpressionStateObject( parent, stringStateObject, expression.hasNot(), patternValue, literal(expression.getEscapeCharacter(), LiteralType.STRING_LITERAL) ); stateObject.setExpression(expression); this.stateObject = stateObject; }
/** * {@inheritDoc} */ @Override public void visit(LikeExpression expression) { // Create the first expression expression.getStringExpression().accept(this); Expression firstExpression = queryExpression; // Create the expression for the pattern value expression.getPatternValue().accept(this); Expression patternValue = queryExpression; // Create the LIKE expression with the escape character if (expression.hasEscapeCharacter()) { expression.getEscapeCharacter().accept(this); queryExpression = firstExpression.like(patternValue, queryExpression); } // Create the LIKE expression with no escape character else { queryExpression = firstExpression.like(patternValue); } // Negate the expression if (expression.hasNot()) { queryExpression = queryExpression.not(); } // Set the expression type type[0] = Boolean.class; }
/** * {@inheritDoc} */ @Override public void visit(LikeExpression expression) { // Create the first expression expression.getStringExpression().accept(this); Expression firstExpression = queryExpression; // Create the expression for the pattern value expression.getPatternValue().accept(this); Expression patternValue = queryExpression; // Create the LIKE expression with the escape character if (expression.hasEscapeCharacter()) { expression.getEscapeCharacter().accept(this); queryExpression = firstExpression.like(patternValue, queryExpression); } // Create the LIKE expression with no escape character else { queryExpression = firstExpression.like(patternValue); } // Negate the expression if (expression.hasNot()) { queryExpression = queryExpression.not(); } // Set the expression type type[0] = Boolean.class; }
length(expression.getStringExpression()) + (expression.hasSpaceAfterStringExpression() ? 1 : 0) + (expression.hasNot() ? 4 : 0) + 4 /* LIKE */ + (expression.hasSpaceAfterLike() ? 1 : 0) + 4 /* LIKE */ + (expression.hasSpaceAfterStringExpression() ? 1 : 0) + (expression.hasNot() ? 1 : 0) + (expression.hasSpaceAfterLike() ? 1 : 0) + length(expression.getPatternValue()) +
length(expression.getStringExpression()) + (expression.hasSpaceAfterStringExpression() ? 1 : 0) + (expression.hasNot() ? 4 : 0) + 4 /* LIKE */ + (expression.hasSpaceAfterLike() ? 1 : 0) + 4 /* LIKE */ + (expression.hasSpaceAfterStringExpression() ? 1 : 0) + (expression.hasNot() ? 1 : 0) + (expression.hasSpaceAfterLike() ? 1 : 0) + length(expression.getPatternValue()) +
4 /* LIKE */ + (expression.hasSpaceAfterStringExpression() ? 1 : 0) + (expression.hasNot() ? 1 : 0) + (expression.hasSpaceAfterLike() ? 1 : 0); 4 /* LIKE */ + (expression.hasSpaceAfterStringExpression() ? 1 : 0) + (expression.hasNot() ? 1 : 0) + (expression.hasSpaceAfterLike() ? 1 : 0) + length(expression.getPatternValue()) +
4 /* LIKE */ + (expression.hasSpaceAfterStringExpression() ? 1 : 0) + (expression.hasNot() ? 1 : 0) + (expression.hasSpaceAfterLike() ? 1 : 0); 4 /* LIKE */ + (expression.hasSpaceAfterStringExpression() ? 1 : 0) + (expression.hasNot() ? 1 : 0) + (expression.hasSpaceAfterLike() ? 1 : 0) + length(expression.getPatternValue()) +