LIKE condition is used to specify a search for a pattern.
The string_expression must have a string value. The pattern_value is a
string literal or a string-valued input parameter in which an underscore (_) stands for any
single character, a percent (%) character stands for any sequence of characters (including the
empty sequence), and all other characters stand for themselves. The optional escape_character
is a single-character string literal or a character-valued input parameter (i.e., char or
Character) and is used to escape the special meaning of the underscore and percent characters in
pattern_value.
BNF: like_expression ::= string_expression [NOT] LIKE pattern_value [ESCAPE escape_character]
LikeExpression
| Modifier and Type | Field and Description |
|---|---|
| public static final String | ESCAPE_CHARACTER_PROPERTY
Notifies the escape character property has changed. |
| private StringLiteralStateObject | |
| private boolean | not
Determines whether the |
| public static final String | NOT_PROPERTY
Notifies the visibility of the |
| public static final String | PATTERN_VALUE_PROPERTY
Notifies the pattern value property has changed. |
| private StateObject | |
| public static final String | STRING_STATE_OBJECT_PROPERTY
Notifies the string state object property has changed. |
| private StateObject |
| Access | Constructor and Description |
|---|---|
| public | LikeExpressionStateObject(StateObject
The parent of this state object, which cannot be parent)nullCreates a new |
| public | LikeExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, StateObject nullThe stringStateObject)StateObject representing the string expressionCreates a new |
| public | LikeExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, StateObject nullThe stringStateObject, boolean StateObject representing the string expressionDetermines whether the not, StateObject NOT identifier is part of the expression
or notA string literal or a string-valued input parameter in which an underscore
(_) stands for any single character, a percent (%) character stands for any sequence of
characters (including the empty sequence), and all other characters stand for themselves patternValue, String A single-character string literal or a character-valued input parameter
(i.e., char or Character) and is used to escape the special meaning of the underscore and
percent characters in escapeCharacter)pattern_valueCreates a new |
| public | LikeExpressionStateObject(StateObject
The parent of this state object, which cannot be parent, StateObject nullThe stringStateObject, StateObject StateObject representing the string expressiona string literal or a string-valued input parameter in which an underscore
(_) stands for any single character, a percent (%) character stands for any sequence of
characters (including the empty sequence), and all other characters stand for themselves patternValue)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(StateObjectVisitor
The visitor)visitor to visit this objectImplements org. StateObject by the given visitor.
|
| protected void | addChildren(List<StateObject>
The list used to store the children children)Overrides org. StateObject to the given list.
|
| public LikeExpressionStateObject | |
| public String | |
| public LikeExpression | getExpression()
Overrides org. Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| public StateObject | |
| public StateObject | |
| public boolean | |
| public boolean | Returns: true if the NOT identifier is part of the expression;
false otherwiseDetermines whether the |
| public boolean | |
| public boolean | |
| protected void | initialize()
Overrides org. |
| public boolean | isEquivalent(StateObject
The stateObject)StateObject to compare its content to this oneOverrides org. Implements org. StateObject is equivalent to this one, i.e. the
information of both StateObject is the same.
|
| public void | |
| public void | |
| public void | setExpression(LikeExpression
The expression)parsed object representing a LIKE
expressionKeeps a reference of the |
| public void | setNot(boolean
true if the NOT identifier should be part of the
expression; false otherwiseSets whether the |
| public void | |
| public void | |
| public void | |
| protected void | toTextInternal(Appendable
The writer used to print out the string representation writer)Implements abstract org. StateObject, which should not be used to
define a true string representation of a JPQL query but should be used for
debugging purposes.
|
| ESCAPE_CHARACTER_PROPERTY | back to summary |
|---|---|
| public static final String ESCAPE_CHARACTER_PROPERTY Notifies the escape character property has changed. | |
| escapeCharacter | back to summary |
|---|---|
| private StringLiteralStateObject escapeCharacter | |
| not | back to summary |
|---|---|
| private boolean not Determines whether the | |
| NOT_PROPERTY | back to summary |
|---|---|
| public static final String NOT_PROPERTY Notifies the visibility of the | |
| PATTERN_VALUE_PROPERTY | back to summary |
|---|---|
| public static final String PATTERN_VALUE_PROPERTY Notifies the pattern value property has changed. | |
| patternValue | back to summary |
|---|---|
| private StateObject patternValue | |
| STRING_STATE_OBJECT_PROPERTY | back to summary |
|---|---|
| public static final String STRING_STATE_OBJECT_PROPERTY Notifies the string state object property has changed. | |
| stringStateObject | back to summary |
|---|---|
| private StateObject stringStateObject | |
| LikeExpressionStateObject | back to summary |
|---|---|
| public LikeExpressionStateObject(StateObject parent) Creates a new
| |
| LikeExpressionStateObject | back to summary |
|---|---|
| public LikeExpressionStateObject(StateObject parent, StateObject stringStateObject) Creates a new
| |
| LikeExpressionStateObject | back to summary |
|---|---|
| public LikeExpressionStateObject(StateObject parent, StateObject stringStateObject, boolean not, StateObject patternValue, String escapeCharacter) Creates a new
| |
| LikeExpressionStateObject | back to summary |
|---|---|
| public LikeExpressionStateObject(StateObject parent, StateObject stringStateObject, StateObject patternValue) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(StateObjectVisitor visitor) Implements org. Doc from org. Visits this
| |
| addChildren | back to summary |
|---|---|
| protected void addChildren(List<StateObject> children) Overrides org. Doc from org. Adds the children of this
| |
| addNot | back to summary |
|---|---|
| public LikeExpressionStateObject addNot() Makes sure the
| |
| getEscapeCharacter | back to summary |
|---|---|
| public String getEscapeCharacter() | |
| getExpression | back to summary |
|---|---|
| public LikeExpression getExpression() Overrides org. Implements org. Doc from org. Returns the actual parsed object if this
| |
| getPatternValue | back to summary |
|---|---|
| public StateObject getPatternValue() | |
| getStringStateObject | back to summary |
|---|---|
| public StateObject getStringStateObject() | |
| hasEscapeCharacter | back to summary |
|---|---|
| public boolean hasEscapeCharacter() | |
| hasNot | back to summary |
|---|---|
| public boolean hasNot() Determines whether the
| |
| hasPatternValue | back to summary |
|---|---|
| public boolean hasPatternValue() | |
| hasStringStateObject | back to summary |
|---|---|
| public boolean hasStringStateObject() | |
| initialize | back to summary |
|---|---|
| protected void initialize() Overrides org. Doc from org. Initializes this state object.
| |
| isEquivalent | back to summary |
|---|---|
| public boolean isEquivalent(StateObject stateObject) Overrides org. Implements org. Doc from org. Determines whether the given
| |
| removeNot | back to summary |
|---|---|
| public void removeNot() Makes sure the | |
| setEscapeCharacter | back to summary |
|---|---|
| public void setEscapeCharacter(String escapeCharacter) | |
| setExpression | back to summary |
|---|---|
| public void setExpression(LikeExpression expression) Keeps a reference of the
| |
| setNot | back to summary |
|---|---|
| public void setNot(boolean not) Sets whether the
| |
| setPatternValue | back to summary |
|---|---|
| public void setPatternValue(StateObject patternValue) | |
| setStringStateObject | back to summary |
|---|---|
| public void setStringStateObject(StateObject stringStateObject) | |
| toggleNot | back to summary |
|---|---|
| public void toggleNot() Changes the visibility state of the | |
| toTextInternal | back to summary |
|---|---|
| protected void toTextInternal(Appendable writer) throws IOException Implements abstract org. Doc from org. Prints out a string representation of this
| |