trim_character
is a single-character string literal or a character-valued input parameter (i.e., char or
Character). If a trim specification is not provided, BOTH is assumed. The TRIM
function returns the trimmed string.
JPA 1.0, 2.0:
expression ::= TRIM([[trim_specification] [trim_character] FROM] string_primary)trim_character ::= string_literal | input_parameterexpression ::= TRIM([[trim_specification] [trim_character] FROM] string_expression)trim_character ::= string_literal | input_parameterUPDATE Student st SET st.sname=TRIM(st.sname)| Modifier and Type | Class and Description |
|---|---|
| public static enum | TrimExpression.Specification
The possible ways to trim the string. |
| Modifier and Type | Field and Description |
|---|---|
| private String | fromIdentifier
The actual FROM identifier found in the string representation of the JPQL query. |
| private boolean | hasFrom
Determines whether the identifier FROM was part of the query. |
| private boolean | hasSpaceAfterFrom
Determines whether a space was parsed after the identifier FROM. |
| private boolean | hasSpaceAfterSpecification
Determines whether a space was parsed after the trim specification. |
| private boolean | hasSpaceAfterTrimCharacter
Determines whether a space was parsed after the trim character. |
| private TrimExpression. | specification
The specification specifies how to trim the string. |
| private String | specificationIdentifier
The actual trim specification identifier found in the string representation of the JPQL query. |
| private AbstractExpression | trimCharacter
The character used for trimming the string. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(ExpressionVisitor
The visitor)ExpressionVisitor to visit this objectImplements org. Expression by the given visitor.
|
| public void | acceptChildren(ExpressionVisitor
The visitor)visitor to visit the children of this object.Overrides org. Implements org. Expression.
|
| protected void | addOrderedEncapsulatedExpressionTo(List<Expression>
The list used to store the string representation of the encapsulated children)
Adds the ExpressionExpressions representing the encapsulated Expression.
|
| public String | Returns: The FROM identifier that was actually parsed, or an empty string if it was not parsedReturns the actual FROM identifier found in the string representation of the JPQL query, which has the actual case that was used. |
| public String | Returns: The specification identifier that was actually parsed, or an empty string if it was not parsedReturns the actual specification identifier found in the string representation of the JPQL query, which has the actual case that was used. |
| public String | getEncapsulatedExpressionQueryBNFId()
Implements abstract org. |
| public JPQLQueryBNF | getQueryBNF()
Implements org. Expression.
|
| public TrimExpression. | Returns: One of the available choices for trimming the stringReturns the specification which specifies how to trim the string. |
| public Expression | Returns: The character, if one was parsed, that will be used to trim the string. If the character was not specified, then '\0' is the characterReturns the character used for trimming the string. |
| public boolean | hasEncapsulatedExpression()
Determines whether something was parsed after the left parenthesis.
|
| public boolean | Returns: true if the identifier FROM was parsed; false otherwiseDetermines whether the identifier FROM was part of the query. |
| public boolean | Returns: true if there was a whitespace after FROM; false otherwiseDetermines whether a whitespace was found after FROM. |
| public boolean | Returns: true if there was a whitespace after the trim specification;
false otherwiseDetermines whether a whitespace was found after the way the string is trimmed. |
| public boolean | Returns: true if there was a whitespace after the trim character;
false otherwiseDetermines whether a whitespace was found after the character used to trim the string. |
| public boolean | Returns: true if the query contained the way the trim needs to
be trimmed; false otherwiseDetermines whether the way the trim is trimmed was parsed. |
| public boolean | Returns: true if the character used for trimming was specified; false
otherwiseDetermines whether the character used to trim the string was specified. |
| protected void | parseEncapsulatedExpression(WordParser
The text to parse based on the current position of the cursor wordParser, int The number of whitespace characters that were parsed after '(' whitespaceCount, boolean Determines whether the parsing system should be tolerant, meaning if it should
try to parse invalid or incomplete queries tolerant)
Parses the encapsulated expression by starting at the current position, which is part of the
given WordParser.
|
| private TrimExpression. | |
| protected void | toParsedTextEncapsulatedExpression(StringBuilder
The buffer used to append the encapsulated writer, boolean Expression's string
representationDetermines whether to include any characters that are considered
virtual, i.e. that was parsed when the query is incomplete and is needed for functionality
like content assist actual)
Generates a string representation of the encapsulated Expression.
|
| fromIdentifier | back to summary |
|---|---|
| private String fromIdentifier The actual FROM identifier found in the string representation of the JPQL query. | |
| hasFrom | back to summary |
|---|---|
| private boolean hasFrom Determines whether the identifier FROM was part of the query. | |
| hasSpaceAfterFrom | back to summary |
|---|---|
| private boolean hasSpaceAfterFrom Determines whether a space was parsed after the identifier FROM. | |
| hasSpaceAfterSpecification | back to summary |
|---|---|
| private boolean hasSpaceAfterSpecification Determines whether a space was parsed after the trim specification. | |
| hasSpaceAfterTrimCharacter | back to summary |
|---|---|
| private boolean hasSpaceAfterTrimCharacter Determines whether a space was parsed after the trim character. | |
| specification | back to summary |
|---|---|
| private TrimExpression. The specification specifies how to trim the string. | |
| specificationIdentifier | back to summary |
|---|---|
| private String specificationIdentifier The actual trim specification identifier found in the string representation of the JPQL query. | |
| trimCharacter | back to summary |
|---|---|
| private AbstractExpression trimCharacter The character used for trimming the string. | |
| TrimExpression | back to summary |
|---|---|
| public TrimExpression(AbstractExpression parent) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(ExpressionVisitor visitor) Implements org. Doc from org. Visits this
| |
| acceptChildren | back to summary |
|---|---|
| public void acceptChildren(ExpressionVisitor visitor) Overrides org. Implements org. Doc from org. Visits the children of this
This does not traverse the
| |
| addOrderedEncapsulatedExpressionTo | back to summary |
|---|---|
| protected void addOrderedEncapsulatedExpressionTo(List<Expression> children) Adds the
| |
| getActualFromIdentifier | back to summary |
|---|---|
| public String getActualFromIdentifier() Returns the actual FROM identifier found in the string representation of the JPQL query, which has the actual case that was used.
| |
| getActualSpecificationIdentifier | back to summary |
|---|---|
| public String getActualSpecificationIdentifier() Returns the actual specification identifier found in the string representation of the JPQL query, which has the actual case that was used.
| |
| getEncapsulatedExpressionQueryBNFId | back to summary |
|---|---|
| public String getEncapsulatedExpressionQueryBNFId() Implements abstract org. Returns the BNF used to parse the encapsulated expression. | |
| getQueryBNF | back to summary |
|---|---|
| public JPQLQueryBNF getQueryBNF() Implements org. Doc from org. Returns the BNF of this
| |
| getSpecification | back to summary |
|---|---|
| public TrimExpression. Returns the specification which specifies how to trim the string.
| |
| getTrimCharacter | back to summary |
|---|---|
| public Expression getTrimCharacter() Returns the character used for trimming the string.
| |
| hasEncapsulatedExpression | back to summary |
|---|---|
| public boolean hasEncapsulatedExpression() Doc from org. Determines whether something was parsed after the left parenthesis.
| |
| hasFrom | back to summary |
|---|---|
| public boolean hasFrom() Determines whether the identifier FROM was part of the query.
| |
| hasSpaceAfterFrom | back to summary |
|---|---|
| public boolean hasSpaceAfterFrom() Determines whether a whitespace was found after FROM.
| |
| hasSpaceAfterSpecification | back to summary |
|---|---|
| public boolean hasSpaceAfterSpecification() Determines whether a whitespace was found after the way the string is trimmed.
| |
| hasSpaceAfterTrimCharacter | back to summary |
|---|---|
| public boolean hasSpaceAfterTrimCharacter() Determines whether a whitespace was found after the character used to trim the string.
| |
| hasSpecification | back to summary |
|---|---|
| public boolean hasSpecification() Determines whether the way the trim is trimmed was parsed.
| |
| hasTrimCharacter | back to summary |
|---|---|
| public boolean hasTrimCharacter() Determines whether the character used to trim the string was specified.
| |
| parseEncapsulatedExpression | back to summary |
|---|---|
| protected void parseEncapsulatedExpression(WordParser wordParser, int whitespaceCount, boolean tolerant) Doc from org. Parses the encapsulated expression by starting at the current position, which is part of the
given
| |
| parseTrimSpecification | back to summary |
|---|---|
| private TrimExpression. | |
| toParsedTextEncapsulatedExpression | back to summary |
|---|---|
| protected void toParsedTextEncapsulatedExpression(StringBuilder writer, boolean actual) Generates a string representation of the encapsulated
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final TrimExpression. | BOTH
The leading and trailing parts of the string will be trimmed. |
| public static final TrimExpression. | DEFAULT
Used when the trim specification is not specified, by default it means the leading and trailing parts of the string will be trimmed. |
| public static final TrimExpression. | LEADING
Only the leading part of the string will be trimmed. |
| public static final TrimExpression. | TRAILING
Only the trailing part of the string will be trimmed. |
| private String | value
The actual constant associated with the constant. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public static TrimExpression. | |
| public static TrimExpression. |
| BOTH | back to summary |
|---|---|
| public static final TrimExpression. The leading and trailing parts of the string will be trimmed. | |
| DEFAULT | back to summary |
|---|---|
| public static final TrimExpression. Used when the trim specification is not specified, by default it means the leading and trailing parts of the string will be trimmed. | |
| LEADING | back to summary |
|---|---|
| public static final TrimExpression. Only the leading part of the string will be trimmed. | |
| TRAILING | back to summary |
|---|---|
| public static final TrimExpression. Only the trailing part of the string will be trimmed. | |
| value | back to summary |
|---|---|
| private String value The actual constant associated with the constant. | |
| Specification | back to summary |
|---|---|
| private Specification(String value) | |
| getValue | back to summary |
|---|---|
| public String getValue() Returns the actual identifier associated with the constant. | |
| valueOf | back to summary |
|---|---|
| public static TrimExpression. | |
| values | back to summary |
|---|---|
| public static TrimExpression. | |