接口 StringExpression

所有超级接口:
ComparableExpression<String>, Expression<String>, Selection<String>
所有已知子接口:
ConfigurableSubQuery.Str, PropExpression.Str, StringExpressionImplementor, TypedSubQuery.Str

public interface StringExpression extends ComparableExpression<String>
  • 方法详细资料

    • like

      @NotNull default @NotNull Predicate like(String pattern)
      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

      @Nullable default @Nullable Predicate likeIf(boolean condition, @Nullable @Nullable String pattern)
      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 check
      pattern - 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

      @Nullable default @Nullable Predicate likeIf(@Nullable @Nullable String pattern)
      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

      @NotNull @NotNull Predicate like(String pattern, LikeMode likeMode)
      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 null
      likeMode - 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 be LikeMode.ANYWHERE, LikeMode.START, LikeMode.END or LikeMode.EXACT
      返回:
      The `like` expression or null
    • likeIf

      @Nullable default @Nullable Predicate likeIf(@Nullable @Nullable String pattern, LikeMode likeMode)
      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 expression
      likeMode - The like mode which can be LikeMode.ANYWHERE, LikeMode.START, LikeMode.END or LikeMode.EXACT
      返回:
      The `like` expression or null
    • ilike

      @NotNull default @NotNull Predicate ilike(String pattern)
      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

      @Nullable default @Nullable Predicate ilikeIf(@Nullable @Nullable String pattern)
      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

      @NotNull @NotNull Predicate ilike(String pattern, LikeMode likeMode)
      Returns a case-insensitive LIKE predicate with the given pattern and match mode.

      Neither the pattern nor like mode may be null, otherwise NullPointerException will be thrown.

      参数:
      pattern - the pattern to match in the LIKE predicate, must not be null
      likeMode - the mode determining how to match the pattern, must not be null
      返回:
      the case-insensitive LIKE predicate
      抛出:
      NullPointerException - if pattern or likeMode is 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 be LikeMode.ANYWHERE, LikeMode.START, LikeMode.END or LikeMode.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 expression
      likeMode - The like mode which can be LikeMode.ANYWHERE, LikeMode.START, LikeMode.END or LikeMode.EXACT
      返回:
      The `insensitively like` expression or null
    • upper

    • lower

    • trim

      Returns a string with leading and trailing whitespace removed.
      返回:
      a trimmed version of this string expression
    • ltrim

      Returns a string with leading whitespace removed.
      返回:
      a left-trimmed version of this string expression
    • rtrim

      Returns a string with trailing whitespace removed.
      返回:
      a right-trimmed version of this string expression
    • length

      Returns the length of the string.
      返回:
      an expression representing the length of this string
    • replace

      StringExpression replace(String target, String replacement)
      Replaces all occurrences of a specified target string with a specified replacement string.
      参数:
      target - the string to be replaced
      replacement - 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

      StringExpression lpad(int length, String padString)
      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 string
      padString - the string to use for padding
      返回:
      a left-padded string expression
    • lpad

      StringExpression lpad(Expression<Integer> length, String padString)
      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 string
      padString - the string to use for padding
      返回:
      a left-padded string expression
    • rpad

      StringExpression rpad(int length, String padString)
      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 string
      padString - the string to use for padding
      返回:
      a right-padded string expression
    • rpad

      StringExpression rpad(Expression<Integer> length, String padString)
      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 string
      padString - the string to use for padding
      返回:
      a right-padded string expression
    • position

      default NumericExpression<Integer> position(String substring)
      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

      default NumericExpression<Integer> position(String substring, int start)
      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 find
      start - the position to start the search from (1-based)
      返回:
      an expression representing the position of the substring
    • position

      NumericExpression<Integer> 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. 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
      start - the expression representing the position to start the search from (1-based)
      返回:
      an expression representing the position of the substring
    • left

      default StringExpression left(int length)
      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

      default StringExpression right(int length)
      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

      StringExpression concat(String... others)
    • concat

      @NotNull @NotNull StringExpression concat(Expression<String>... others)
    • substring

      default StringExpression substring(int start)
      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

      default StringExpression substring(int start, int length)
      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

      default StringExpression substring(Expression<Integer> start)
      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

      StringExpression substring(Expression<Integer> start, Expression<Integer> length)
      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

      @NotNull @NotNull StringExpression coalesce(String defaultValue)
      指定者:
      coalesce 在接口中 ComparableExpression<String>
      指定者:
      coalesce 在接口中 Expression<String>
    • coalesce

      @NotNull @NotNull StringExpression coalesce(Expression<String> defaultExpr)
      指定者:
      coalesce 在接口中 ComparableExpression<String>
      指定者:
      coalesce 在接口中 Expression<String>
    • coalesceBuilder

      @NotNull CoalesceBuilder.Str coalesceBuilder()
      指定者:
      coalesceBuilder 在接口中 ComparableExpression<String>
      指定者:
      coalesceBuilder 在接口中 Expression<String>