Interface TextExpression
- All Superinterfaces:
ComparableExpression<String>, Expression<String>, Selection<String>, TupleElement<String>
Type for string query expressions.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionappend(Expression<String> y) Create an expression for string concatenation.Create an expression for string concatenation.coalesce(Expression<? extends String> y) Create an expression that returns null if this and the argument evaluate to null, and the value of the first non-null expression otherwise.Create an expression that returns null if this and the argument evaluate to null, and the value of the first non-null expression otherwise.Create a predicate for testing whether this expression contains the given substring.Create a predicate for testing whether this expression ends with the given suffix.left(int len) Create an expression for the leftmost substring of this string.left(Expression<Integer> len) Create an expression for the leftmost substring of this string.length()Create expression to return length of this string.like(Expression<String> pattern) Create a predicate for testing whether this expression satisfies the given pattern.like(Expression<String> pattern, char escapeChar) Create a predicate for testing whether this expression satisfies the given pattern.like(Expression<String> pattern, Expression<Character> escapeChar) Create a predicate for testing whether this expression satisfies the given pattern.Create a predicate for testing whether this expression satisfies the given pattern.Create a predicate for testing whether this expression satisfies the given pattern.like(String pattern, Expression<Character> escapeChar) Create a predicate for testing whether this expression satisfies the given pattern.locate(Expression<String> pattern) Create expression to locate the position of one string within this, returning position of first character if found.locate(Expression<String> pattern, Expression<Integer> from) Create expression to locate the position of one string within this, returning position of first character if found.Create expression to locate the position of one string within this, returning position of first character if found.Create expression to locate the position of one string within this, returning position of first character if found.lower()Create expression for converting this string to lowercase.notContains(String substring) Create a predicate for testing whether this expression does not contain the given substring.notEndsWith(String suffix) Create a predicate for testing whether this expression does not end with the given suffix.notLike(Expression<String> pattern) Create a predicate for testing whether this expression does not satisfy the given pattern.notLike(Expression<String> pattern, char escapeChar) Create a predicate for testing whether this expression does not satisfy the given pattern.notLike(Expression<String> pattern, Expression<Character> escapeChar) Create a predicate for testing whether this expression does not satisfy the given pattern.Create a predicate for testing whether this expression does not satisfy the given pattern.Create a predicate for testing whether this expression does not satisfy the given pattern.notLike(String pattern, Expression<Character> escapeChar) Create a predicate for testing whether this expression does not satisfy the given pattern.notStartsWith(String prefix) Create a predicate for testing whether this expression does not start with the given prefix.nullif(Expression<? extends String> y) Create an expression that tests whether this expression is equal to the argument, returning null if they are and the value of the first expression if they are not.Create an expression that tests whether this expression is equal to the argument, returning null if they are and the value of the first expression if they are not.prepend(Expression<String> y) Create an expression for string concatenation.Create an expression for string concatenation.replace(Expression<String> substring, Expression<String> replacement) Create an expression replacing every occurrence of a substring within this string.replace(Expression<String> substring, String replacement) Create an expression replacing every occurrence of a substring within this string.replace(String substring, Expression<String> replacement) Create an expression replacing every occurrence of a substring within this string.Create an expression replacing every occurrence of a substring within this string.right(int len) Create an expression for the rightmost substring of this string.right(Expression<Integer> len) Create an expression for the rightmost substring of this string.startsWith(String prefix) Create a predicate for testing whether this expression starts with the given prefix.substring(int from) Create an expression for substring extraction.substring(int from, int len) Create an expression for substring extraction.substring(Expression<Integer> from) Create an expression for substring extraction.substring(Expression<Integer> from, Expression<Integer> len) Create an expression for substring extraction.trim()Create expression to trim blanks from both ends of this string.trim(char t) Create expression to trim character from both ends of this string.Create expression to trim blanks from this string.trim(CriteriaBuilder.Trimspec ts, char t) Create expression to trim character from this string.Create expression to trim character from this string.trim(Expression<Character> t) Create expression to trim character from both ends of this string.upper()Create expression for converting this string to uppercase.Methods inherited from interface ComparableExpression
asc, asc, between, between, desc, desc, greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo, max, minMethods inherited from interface Expression
as, cast, count, countDistinct, equalTo, equalTo, in, in, in, in, in, isMember, isNotMember, isNotNull, isNull, notEqualTo, notEqualTo, selectCaseMethods inherited from interface Selection
alias, getCompoundSelectionItems, isCompoundSelectionMethods inherited from interface TupleElement
getAlias, getJavaType
-
Method Details
-
like
Create a predicate for testing whether this expression satisfies the given pattern.- Parameters:
pattern- string expression- Returns:
- like predicate
- See Also:
-
like
-
like
@Nonnull Predicate like(@Nonnull Expression<String> pattern, @Nonnull Expression<Character> escapeChar) Create a predicate for testing whether this expression satisfies the given pattern.- Parameters:
pattern- string expressionescapeChar- escape character expression- Returns:
- like predicate
- See Also:
-
like
Create a predicate for testing whether this expression satisfies the given pattern.- Parameters:
pattern- string expressionescapeChar- escape character- Returns:
- like predicate
- See Also:
-
like
Create a predicate for testing whether this expression satisfies the given pattern.- Parameters:
pattern- stringescapeChar- escape character expression- Returns:
- like predicate
- See Also:
-
like
-
notLike
Create a predicate for testing whether this expression does not satisfy the given pattern.- Parameters:
pattern- string expression- Returns:
- not-like predicate
- See Also:
-
notLike
-
notLike
@Nonnull Predicate notLike(@Nonnull Expression<String> pattern, @Nonnull Expression<Character> escapeChar) Create a predicate for testing whether this expression does not satisfy the given pattern.- Parameters:
pattern- string expressionescapeChar- escape character expression- Returns:
- not-like predicate
- See Also:
-
notLike
Create a predicate for testing whether this expression does not satisfy the given pattern.- Parameters:
pattern- string expressionescapeChar- escape character- Returns:
- not-like predicate
- See Also:
-
notLike
Create a predicate for testing whether this expression does not satisfy the given pattern.- Parameters:
pattern- stringescapeChar- escape character expression- Returns:
- not-like predicate
- See Also:
-
notLike
-
contains
-
notContains
-
startsWith
-
notStartsWith
-
endsWith
-
notEndsWith
-
append
Create an expression for string concatenation.- Parameters:
y- string expression- Returns:
- expression corresponding to concatenation
- See Also:
-
append
Create an expression for string concatenation.- Parameters:
y- string- Returns:
- expression corresponding to concatenation
- See Also:
-
prepend
Create an expression for string concatenation.- Parameters:
y- string expression- Returns:
- expression corresponding to concatenation
- See Also:
-
prepend
Create an expression for string concatenation.- Parameters:
y- string- Returns:
- expression corresponding to concatenation
- See Also:
-
substring
Create an expression for substring extraction. Extracts a substring starting at the specified position through to end of the string. First position is 1.- Parameters:
from- start position expression- Returns:
- expression corresponding to substring extraction
- See Also:
-
substring
Create an expression for substring extraction. Extracts a substring starting at the specified position through to end of the string. First position is 1.- Parameters:
from- start position- Returns:
- expression corresponding to substring extraction
- See Also:
-
substring
@Nonnull TextExpression substring(@Nonnull Expression<Integer> from, @Nonnull Expression<Integer> len) Create an expression for substring extraction. Extracts a substring of given length starting at the specified position. First position is 1.- Parameters:
from- start position expressionlen- length expression- Returns:
- expression corresponding to substring extraction
- See Also:
-
substring
Create an expression for substring extraction. Extracts a substring of given length starting at the specified position. First position is 1.- Parameters:
from- start positionlen- length- Returns:
- expression corresponding to substring extraction
- See Also:
-
trim
Create expression to trim blanks from both ends of this string.- Returns:
- trim expression
- See Also:
-
trim
Create expression to trim blanks from this string.- Parameters:
ts- trim specification- Returns:
- trim expression
- See Also:
-
trim
Create expression to trim character from both ends of this string.- Parameters:
t- expression for character to be trimmed- Returns:
- trim expression
- See Also:
-
trim
@Nonnull TextExpression trim(@Nonnull CriteriaBuilder.Trimspec ts, @Nonnull Expression<Character> t) Create expression to trim character from this string.- Parameters:
ts- trim specificationt- expression for character to be trimmed- Returns:
- trim expression
- See Also:
-
trim
Create expression to trim character from both ends of this string.- Parameters:
t- character to be trimmed- Returns:
- trim expression
- See Also:
-
trim
Create expression to trim character from this string.- Parameters:
ts- trim specificationt- character to be trimmed- Returns:
- trim expression
- See Also:
-
lower
Create expression for converting this string to lowercase.- Returns:
- expression to convert to lowercase
- See Also:
-
upper
Create expression for converting this string to uppercase.- Returns:
- expression to convert to uppercase
- See Also:
-
length
Create expression to return length of this string.- Returns:
- length expression
- See Also:
-
left
Create an expression for the leftmost substring of this string.- Parameters:
len- length of the substring to return- Returns:
- expression for the leftmost substring
- See Also:
-
right
Create an expression for the rightmost substring of this string.- Parameters:
len- length of the substring to return- Returns:
- expression for the rightmost substring
- See Also:
-
left
Create an expression for the leftmost substring of this string.- Parameters:
len- length of the substring to return- Returns:
- expression for the leftmost substring
- See Also:
-
right
Create an expression for the rightmost substring of this string.- Parameters:
len- length of the substring to return- Returns:
- expression for the rightmost substring
- See Also:
-
replace
@Nonnull TextExpression replace(@Nonnull Expression<String> substring, @Nonnull Expression<String> replacement) Create an expression replacing every occurrence of a substring within this string.- Parameters:
substring- the literal substring to replacereplacement- the replacement string- Returns:
- expression for the resulting string
- See Also:
-
replace
Create an expression replacing every occurrence of a substring within this string.- Parameters:
substring- the literal substring to replacereplacement- the replacement string- Returns:
- expression for the resulting string
- See Also:
-
replace
Create an expression replacing every occurrence of a substring within this string.- Parameters:
substring- the literal substring to replacereplacement- the replacement string- Returns:
- expression for the resulting string
- See Also:
-
replace
Create an expression replacing every occurrence of a substring within this string.- Parameters:
substring- the literal substring to replacereplacement- the replacement string- Returns:
- expression for the resulting string
- See Also:
-
locate
Create expression to locate the position of one string within this, returning position of first character if found. The first position in a string is denoted by 1. If the string to be located is not found, 0 is returned.Warning: the order of the parameters of this method is reversed compared to the corresponding function in JPQL.
- Parameters:
pattern- expression for string to be located- Returns:
- expression corresponding to position
- See Also:
-
locate
Create expression to locate the position of one string within this, returning position of first character if found. The first position in a string is denoted by 1. If the string to be located is not found, 0 is returned.Warning: the order of the parameters of this method is reversed compared to the corresponding function in JPQL.
- Parameters:
pattern- string to be located- Returns:
- expression corresponding to position
- See Also:
-
locate
@Nonnull NumericExpression<Integer> locate(@Nonnull Expression<String> pattern, @Nonnull Expression<Integer> from) Create expression to locate the position of one string within this, returning position of first character if found. The first position in a string is denoted by 1. If the string to be located is not found, 0 is returned.Warning: the order of the first two parameters of this method is reversed compared to the corresponding function in JPQL.
- Parameters:
pattern- expression for string to be locatedfrom- expression for position at which to start search- Returns:
- expression corresponding to position
- See Also:
-
locate
Create expression to locate the position of one string within this, returning position of first character if found. The first position in a string is denoted by 1. If the string to be located is not found, 0 is returned.Warning: the order of the first two parameters of this method is reversed compared to the corresponding function in JPQL.
- Parameters:
pattern- string to be locatedfrom- position at which to start search- Returns:
- expression corresponding to position
- See Also:
-
coalesce
Description copied from interface:ExpressionCreate an expression that returns null if this and the argument evaluate to null, and the value of the first non-null expression otherwise.- Specified by:
coalescein interfaceComparableExpression<String>- Specified by:
coalescein interfaceExpression<String>- Parameters:
y- value- Returns:
- coalesce expression
-
coalesce
Description copied from interface:ExpressionCreate an expression that returns null if this and the argument evaluate to null, and the value of the first non-null expression otherwise.- Specified by:
coalescein interfaceComparableExpression<String>- Specified by:
coalescein interfaceExpression<String>- Parameters:
y- expression- Returns:
- coalesce expression
-
nullif
Description copied from interface:ExpressionCreate an expression that tests whether this expression is equal to the argument, returning null if they are and the value of the first expression if they are not.- Specified by:
nullifin interfaceComparableExpression<String>- Specified by:
nullifin interfaceExpression<String>- Parameters:
y- value- Returns:
- nullif expression
-
nullif
Description copied from interface:ExpressionCreate an expression that tests whether this expression is equal to the argument, returning null if they are and the value of the first expression if they are not.- Specified by:
nullifin interfaceComparableExpression<String>- Specified by:
nullifin interfaceExpression<String>- Parameters:
y- expression- Returns:
- nullif expression
-