接口 StringExpression
- 所有超级接口:
ComparableExpression<String>,Expression<String>,Selection<String>
- 所有已知子接口:
ConfigurableSubQuery.Str,PropExpression.Str,StringExpressionImplementor,TypedSubQuery.Str
-
嵌套类概要
从接口继承的嵌套类/接口 org.babyfish.jimmer.sql.ast.Expression
Expression.AnyFactory, Expression.ComparableFactory, Expression.DateFactory, Expression.NumericFactory, Expression.StringFactory, Expression.TemporalFactory -
方法概要
修饰符和类型方法说明@NotNull StringExpression@NotNull StringExpressioncoalesce(Expression<String> defaultExpr) @NotNull StringExpressionconcat(Expression<String>... others) default @NotNull PredicateReturns a case-insensitive like predicate for the given pattern with default match mode.@NotNull PredicateReturns a case-insensitive LIKE predicate with the given pattern and match mode.default @Nullable PredicateCreate `case-insensitive like` expression when the argument `condition` is true and the argument `pattern` is neither null nor empty string.default @Nullable PredicateCreate `insensitively like` expression when the argument `condition` is true and the argument `pattern` is neither null nor empty string.default @Nullable PredicateCreate `case-insensitive like` expression when the argument `pattern` is neither null nor empty string.default @Nullable PredicateCreate `insensitively like` expression when the argument `pattern` is neither null nor empty string.default StringExpressionleft(int length) Returns the leftmost characters from a string.left(Expression<Integer> length) Returns the leftmost characters from a string.length()Returns the length of the string.default @NotNull PredicateReturns a LIKE predicate for the given pattern with default match mode.@NotNull PredicateReturns a LIKE predicate with the given pattern and match mode.default @Nullable PredicateReturns a LIKE predicate if the given condition is true and pattern is not null or empty.default @Nullable PredicateCreate `like` expression when the argument `condition` is true and the argument `pattern` is neither null nor empty string.default @Nullable PredicateReturns a LIKE predicate if the given pattern is not null or empty.default @Nullable PredicateCreate `like` expression when the argument `pattern` is neither null nor empty string.lower()Left-pads a string with a specified pad string to a certain length.lpad(Expression<Integer> length, String padString) Left-pads a string with a specified pad string to a certain length.ltrim()Returns a string with leading whitespace removed.default NumericExpression<Integer> Returns the position of the first occurrence of a substring in a string.default NumericExpression<Integer> Returns the position of the first occurrence of a substring in a string, starting the search at a specified position.position(String substring, Expression<Integer> start) Returns the position of the first occurrence of a substring in a string, starting the search at a specified position.Replaces all occurrences of a specified target string with a specified replacement string.reverse()Returns a string with characters in reverse order.default StringExpressionright(int length) Returns the rightmost characters from a string.right(Expression<Integer> length) Returns the rightmost characters from a string.Right-pads a string with a specified pad string to a certain length.rpad(Expression<Integer> length, String padString) Right-pads a string with a specified pad string to a certain length.rtrim()Returns a string with trailing whitespace removed.default StringExpressionsubstring(int start) Returns a substring starting from the specified position (1-based index).default StringExpressionsubstring(int start, int length) Returns a substring starting from the specified position with the specified length.default StringExpressionsubstring(Expression<Integer> start) Returns a substring starting from the specified position (1-based index).substring(Expression<Integer> start, Expression<Integer> length) Returns a substring starting from the specified position with the specified length.trim()Returns a string with leading and trailing whitespace removed.upper()从接口继承的方法 org.babyfish.jimmer.sql.ast.ComparableExpression
between, between, betweenIf, betweenIf, ge, ge, geIf, geIf, gt, gt, gtIf, gtIf, le, le, leIf, leIf, lt, lt, ltIf, ltIf, max, min, notBetween, notBetween, notBetweenIf, notBetweenIf从接口继承的方法 org.babyfish.jimmer.sql.ast.Expression
asc, count, count, desc, eq, eq, eqIf, eqIf, expressionIn, expressionNotIn, in, in, inIf, inIf, inIf, inIf, isNotNull, isNull, ne, ne, neIf, neIf, notIn, notIn, notInIf, notInIf, notInIf, notInIf, nullableIn, nullableInIf, nullableInIf, nullableNotIn, nullableNotInIf, nullableNotInIf
-
方法详细资料
-
like
Returns a LIKE predicate for the given pattern with default match mode.The pattern must not be null. The default match mode used is
LikeMode.ANYWHERE, which matches the pattern anywhere in the value.- 参数:
pattern- the pattern to match, must not be null- 返回:
- the LIKE predicate
- 抛出:
NullPointerException- if the pattern is null
-
likeIf
Returns a LIKE predicate if the given condition is true and pattern is not null or empty. The LIKE predicate matches values that contain the given pattern anywhere in the value (LikeMode.ANYWHERE).- 参数:
condition- the condition to checkpattern- the pattern to match in the LIKE predicate, may be null- 返回:
- a LIKE predicate if the condition is true and pattern is not null or empty, null otherwise
-
likeIf
Returns a LIKE predicate if the given pattern is not null or empty. The LIKE predicate matches values that contain the given pattern anywhere in the value (LikeMode.ANYWHERE).This is an overload of the
likeIf(boolean, String)method that passes a condition of true.- 参数:
pattern- the pattern to match in the LIKE predicate, may be null- 返回:
- a LIKE predicate if the pattern is not null or empty, null otherwise
-
like
Returns a LIKE predicate with the given pattern and match mode.Neither the pattern nor match mode may be null.
- 参数:
pattern- the pattern to match, must not be nulllikeMode- the mode determining how to match the pattern, must not be null- 返回:
- the LIKE predicate
- 抛出:
NullPointerException- if pattern or likeMode is null
-
likeIf
@Nullable default @Nullable Predicate likeIf(boolean condition, @Nullable @Nullable String pattern, LikeMode likeMode) Create `like` expression when the argument `condition` is true and the argument `pattern` is neither null nor empty string.- 参数:
condition- The condition, if it is false, returns null directly, otherwise check the other parameter `pattern`pattern- The pattern, If it is null or empty string, returns null directly, otherwise check the other parameter `condition`likeMode- The like mode which can beLikeMode.ANYWHERE,LikeMode.START,LikeMode.ENDorLikeMode.EXACT- 返回:
- The `like` expression or null
-
likeIf
Create `like` expression when the argument `pattern` is neither null nor empty string.- 参数:
pattern- The pattern, If it is null or empty string, returns null directly, otherwise check create the expressionlikeMode- The like mode which can beLikeMode.ANYWHERE,LikeMode.START,LikeMode.ENDorLikeMode.EXACT- 返回:
- The `like` expression or null
-
ilike
Returns a case-insensitive like predicate for the given pattern with default match mode.The pattern must not be null. The default match mode used is
LikeMode.ANYWHERE, which matches the pattern anywhere in the value.- 参数:
pattern- the pattern to match, must not be null- 返回:
- the case-insensitive LIKE predicate
- 抛出:
NullPointerException- if the pattern is null
-
ilikeIf
@Nullable default @Nullable Predicate ilikeIf(boolean condition, @Nullable @Nullable String pattern) Create `case-insensitive like` expression when the argument `condition` is true and the argument `pattern` is neither null nor empty string.- 参数:
condition- The condition, if it is false, returns null directly, otherwise check the other parameter `pattern`pattern- The pattern, If it is null or empty string, returns null directly, otherwise check the other parameter `condition`- 返回:
- The `insensitively like` expression or null
-
ilikeIf
Create `case-insensitive like` expression when the argument `pattern` is neither null nor empty string.- 参数:
pattern- The pattern, If it is null or empty string, returns null directly, otherwise check create the expression- 返回:
- The `insensitively like` expression or null
-
ilike
Returns a case-insensitive LIKE predicate with the given pattern and match mode.Neither the pattern nor like mode may be null, otherwise
NullPointerExceptionwill be thrown.- 参数:
pattern- the pattern to match in the LIKE predicate, must not be nulllikeMode- the mode determining how to match the pattern, must not be null- 返回:
- the case-insensitive LIKE predicate
- 抛出:
NullPointerException- ifpatternorlikeModeis null
-
ilikeIf
@Nullable default @Nullable Predicate ilikeIf(boolean condition, @Nullable @Nullable String pattern, LikeMode likeMode) Create `insensitively like` expression when the argument `condition` is true and the argument `pattern` is neither null nor empty string.- 参数:
condition- The condition, if it is false, returns null directly, otherwise check the other parameter `pattern`pattern- The pattern, If it is null or empty string, returns null directly, otherwise check the other parameter `condition`likeMode- The like mode which can beLikeMode.ANYWHERE,LikeMode.START,LikeMode.ENDorLikeMode.EXACT- 返回:
- The `insensitively like` expression or null
-
ilikeIf
@Nullable default @Nullable Predicate ilikeIf(@Nullable @Nullable String pattern, LikeMode likeMode) Create `insensitively like` expression when the argument `pattern` is neither null nor empty string.- 参数:
pattern- The pattern, If it is null or empty string, returns null directly, otherwise check create the expressionlikeMode- The like mode which can beLikeMode.ANYWHERE,LikeMode.START,LikeMode.ENDorLikeMode.EXACT- 返回:
- The `insensitively like` expression or null
-
upper
StringExpression upper() -
lower
StringExpression lower() -
trim
StringExpression trim()Returns a string with leading and trailing whitespace removed.- 返回:
- a trimmed version of this string expression
-
ltrim
StringExpression ltrim()Returns a string with leading whitespace removed.- 返回:
- a left-trimmed version of this string expression
-
rtrim
StringExpression rtrim()Returns a string with trailing whitespace removed.- 返回:
- a right-trimmed version of this string expression
-
length
NumericExpression<Integer> length()Returns the length of the string.- 返回:
- an expression representing the length of this string
-
replace
Replaces all occurrences of a specified target string with a specified replacement string.- 参数:
target- the string to be replacedreplacement- the string to replace all occurrences of target- 返回:
- a new string expression with all occurrences of target replaced by replacement
-
reverse
StringExpression reverse()Returns a string with characters in reverse order. For example, reverse("SQL Tutorial") returns "lairotuT LQS".- 返回:
- a new string expression with all characters in reverse order
-
lpad
Left-pads a string with a specified pad string to a certain length. If the original string is longer than the specified length, the result is truncated.- 参数:
length- the desired length of the output stringpadString- the string to use for padding- 返回:
- a left-padded string expression
-
lpad
Left-pads a string with a specified pad string to a certain length. If the original string is longer than the specified length, the result is truncated.- 参数:
length- the expression representing the desired length of the output stringpadString- the string to use for padding- 返回:
- a left-padded string expression
-
rpad
Right-pads a string with a specified pad string to a certain length. If the original string is longer than the specified length, the result is truncated.- 参数:
length- the desired length of the output stringpadString- the string to use for padding- 返回:
- a right-padded string expression
-
rpad
Right-pads a string with a specified pad string to a certain length. If the original string is longer than the specified length, the result is truncated.- 参数:
length- the expression representing the desired length of the output stringpadString- the string to use for padding- 返回:
- a right-padded string expression
-
position
Returns the position of the first occurrence of a substring in a string. The position is 1-based (the first position is 1, not 0). Returns 0 if the substring is not found.- 参数:
substring- the substring to find- 返回:
- an expression representing the position of the substring
-
position
Returns the position of the first occurrence of a substring in a string, starting the search at a specified position. The position is 1-based (the first position is 1, not 0). Returns 0 if the substring is not found.- 参数:
substring- the substring to findstart- the position to start the search from (1-based)- 返回:
- an expression representing the position of the substring
-
position
Returns the position of the first occurrence of a substring in a string, starting the search at a specified position. The position is 1-based (the first position is 1, not 0). Returns 0 if the substring is not found.- 参数:
substring- the substring to findstart- the expression representing the position to start the search from (1-based)- 返回:
- an expression representing the position of the substring
-
left
Returns the leftmost characters from a string.- 参数:
length- the number of characters to extract- 返回:
- a string expression containing the leftmost characters
-
left
Returns the leftmost characters from a string.- 参数:
length- an expression representing the number of characters to extract- 返回:
- a string expression containing the leftmost characters
-
right
Returns the rightmost characters from a string.- 参数:
length- the number of characters to extract- 返回:
- a string expression containing the rightmost characters
-
right
Returns the rightmost characters from a string.- 参数:
length- an expression representing the number of characters to extract- 返回:
- a string expression containing the rightmost characters
-
concat
-
concat
-
substring
Returns a substring starting from the specified position (1-based index).- 参数:
start- the starting position (1-based index)- 返回:
- a substring of this string expression
-
substring
Returns a substring starting from the specified position with the specified length.- 参数:
start- the starting position (1-based index)length- the length of the substring- 返回:
- a substring of this string expression
-
substring
Returns a substring starting from the specified position (1-based index).- 参数:
start- the starting position expression (1-based index)- 返回:
- a substring of this string expression
-
substring
Returns a substring starting from the specified position with the specified length.- 参数:
start- the starting position expression (1-based index)length- the length expression of the substring- 返回:
- a substring of this string expression
-
coalesce
- 指定者:
coalesce在接口中ComparableExpression<String>- 指定者:
coalesce在接口中Expression<String>
-
coalesce
- 指定者:
coalesce在接口中ComparableExpression<String>- 指定者:
coalesce在接口中Expression<String>
-
coalesceBuilder
- 指定者:
coalesceBuilder在接口中ComparableExpression<String>- 指定者:
coalesceBuilder在接口中Expression<String>
-