Interface ExpressionFunctions

All Known Implementing Classes:
Db2Dialect.Db2ExpressionFunctions, H212126Dialect.H212126ExpressionFunctions, H214199Dialect.H214199ExpressionFunctions, H2Dialect.H2ExpressionFunctions, HsqldbDialect.HsqldbExpressionFunctions, Mssql2008Dialect.Mssql2008ExpressionFunctions, MssqlDialect.MssqlExpressionFunctions, MysqlDialect.MysqlExpressionFunctions, NullExpressionFunctions, Oracle11Dialect.Oracle11ExpressionFunctions, OracleDialect.OracleExpressionFunctions, PostgresDialect.PostgresExpressionFunctions, SqliteDialect.SqliteExpressionFunctions, StandardDialect.StandardExpressionFunctions

public interface ExpressionFunctions
The aggregation of functions that are available in expressions in SQL templates.
  • Method Details

    • escape

      String escape(CharSequence text)
      Escapes the SQL LIKE wild card characters in a target string by using the default escape character.

      For example, a%b_ is converted to the a a$%b$_.

      Parameters:
      text - the target text
      Returns:
      the escaped text
    • escape

      String escape(CharSequence text, char escapeChar)
      Escapes the SQL LIKE wild card characters in a target string by using a specified escape character.
      Parameters:
      text - the target text
      escapeChar - the escape character
      Returns:
      the escaped text
    • prefix

      String prefix(CharSequence prefix)
      Escapes the SQL LIKE wild card characters in a target string by using the default escape character '$' and generate a text to perform a prefix search for the SQL Like operator.

      For example, a%b_ is converted to the a a$%b$_%.

      Parameters:
      prefix - the prefix text
      Returns:
      the text for a prefix search
    • prefix

      String prefix(CharSequence prefix, char escapeChar)
      Escapes the SQL LIKE wild card characters in a target string by using a specified escape character and generate a text to perform a prefix search for the SQL LIKE operator.
      Parameters:
      prefix - the prefixed text
      escapeChar - the escape character
      Returns:
      the text for a prefix search
    • suffix

      String suffix(CharSequence suffix)
      Escapes the SQL LIKE wild card characters in a target string by using the default escape character '$' and generate a text to perform a suffix search for the SQL LIKE operator.

      For example, a%b_ is converted to the a %a$%b$_.

      Parameters:
      suffix - the suffix text
      Returns:
      the text for a suffix search
    • suffix

      String suffix(CharSequence suffix, char escapeChar)
      Escapes the SQL LIKE wild card characters in a target string by using a specified escape character and generate a text to perform a suffix search for the SQL LIKE operator.
      Parameters:
      suffix - the suffix text
      escapeChar - the escape character
      Returns:
      the text for a suffix search
    • infix

      String infix(CharSequence infix)
      Escapes the SQL LIKE wild card characters in a target string by using the default escape character '$' and generate a text to perform a infix search for the SQL LIKE operator.

      For example, a%b_ is converted to the a %a$%b$_%.

      Parameters:
      infix - the infix text
      Returns:
      the text for a infix search
    • infix

      String infix(CharSequence infix, char escapeChar)
      Escapes the SQL LIKE wild card characters in a target string by using a specified escape character and generate a text to perform a infix search for the SQL LIKE operator.
      Parameters:
      infix - the infix text
      escapeChar - the escape character
      Returns:
      the text for a infix search
    • roundDownTimePart

      Date roundDownTimePart(Date date)
      Round down a time part of Date.
      Parameters:
      date - the target date
      Returns:
      the date whose time part is rounded down
    • roundDownTimePart

      Date roundDownTimePart(Date date)
      Round down a time part of Date.
      Parameters:
      date - the target date
      Returns:
      the date whose time part is rounded down
    • roundDownTimePart

      Timestamp roundDownTimePart(Timestamp timestamp)
      Round down a time part of Timestamp.
      Parameters:
      timestamp - the target timestamp
      Returns:
      the timestamp whose time part is rounded down
    • roundDownTimePart

      LocalDateTime roundDownTimePart(LocalDateTime localDateTime)
      Round down a time part of LocalDateTime.
      Parameters:
      localDateTime - the target localDateTime
      Returns:
      the localDateTime whose time part is rounded down
    • roundUpTimePart

      Date roundUpTimePart(Date date)
      Round up a time part of Date.
      Parameters:
      date - the target date
      Returns:
      the date whose time part is rounded up
    • roundUpTimePart

      Date roundUpTimePart(Date date)
      Round up a time part of Date.
      Parameters:
      date - the target date
      Returns:
      the date whose time part is rounded up
    • roundUpTimePart

      Timestamp roundUpTimePart(Timestamp timestamp)
      Round up a time part of Timestamp.
      Parameters:
      timestamp - the target timestamp
      Returns:
      the timestamp whose time part is rounded up
    • roundUpTimePart

      LocalDate roundUpTimePart(LocalDate localDate)
      Return the next day.
      Parameters:
      localDate - the target localDate
      Returns:
      the next day
    • roundUpTimePart

      LocalDateTime roundUpTimePart(LocalDateTime localDateTime)
      Round up a time part of LocalDateTime.
      Parameters:
      localDateTime - the target localDateTime
      Returns:
      the localDateTime whose time part is rounded up
    • isEmpty

      boolean isEmpty(CharSequence text)
      Whether a text is empty.
      Parameters:
      text - the target text
      Returns:
      true if the text is null or its length is 0, else false
    • isNotEmpty

      boolean isNotEmpty(CharSequence text)
      Whether a text is not empty.
      Parameters:
      text - the target text
      Returns:
      false if the text is null or its length is 0, else true
    • isBlank

      boolean isBlank(CharSequence text)
      Whether a text is blank.
      Parameters:
      text - the target text
      Returns:
      true if the text is null, its length is 0 or the text contains only blank characters, else false.
    • isNotBlank

      boolean isNotBlank(CharSequence text)
      Whether a text is not blank.
      Parameters:
      text - the target text
      Returns:
      false if the text is null, its length is 0 or the text contains only blank characters, else true.