Interface Dialect

All Known Implementing Classes:
AccessDialect, AnsiIsoDialect, H2Dialect, HsqldbDialect, MariaDbDialect, MySqlDialect, OracleDialect, PostgreSqlDialect, SqliteDialect, SqlServerDialect

public interface Dialect
Defines an SQL dialect as implemented by a specific database vendor.
  • Method Details

    • getProductName

      String getProductName()
      Gets the name of the RDBMS product.
      Returns:
      the name of the RDBMS product.
    • offsetBeforeLimit

      boolean offsetBeforeLimit()
      Indicates whether offset clause must be specified before limit clause; if supported.
      Returns:
      whether offset clause must be specified before limit clause; if supported.
    • formatRowOffsetClause

      Optional<String> formatRowOffsetClause()
      Returns the _row offset clause_ formatted for a specific SQL dialect.
      Returns:
      the _row offset clause_ formatted for a specific SQL dialect.
    • formatRowLimitClause

      Optional<String> formatRowLimitClause()
      Returns the _row limit clause_ formatted for a specific SQL dialect.
      Returns:
      the _row limit clause_ formatted for a specific SQL dialect.
    • formatRowNumLiteral

      Optional<String> formatRowNumLiteral()
      Returns the _row number_ literal formatted for a specific SQL dialect.
      Returns:
      the _row number_ literal formatted for a specific SQL dialect.
    • formatToNumberFunction

      String formatToNumberFunction(String operand, int precision, int scale)
      Returns the 'to_number' function formatted for a specific SQL dialect.
      Parameters:
      operand - the string expression to be evaluated as a number
      precision - the precision that represents the number of significant digits
      scale - the scale that that represents the number of digits after the decimal point. Must be less than or equal to the precision.
      Returns:
      the 'to_number' function for a specific SQL dialect.
    • formatToCharFunction

      String formatToCharFunction(String operand, String format)
      Returns the 'to_char' function formatted for a specific SQL dialect.
      Parameters:
      operand - the expression to be evaluated as a string
      format - the vendor-specific format mask
      Returns:
      the 'to_char' function for a specific SQL dialect.
    • formatSubstringFunction

      String formatSubstringFunction(String operand, int startPos, int length)
      Returns the 'substring' function formatted for a specific SQL dialect.
      Parameters:
      operand - the string expression to get substring from
      startPos - the start position (1-based) of the substring
      length - the length of the substring
      Returns:
      the 'substring' function for a specific SQL dialect.
    • formatConcatFunction

      String formatConcatFunction(List<String> operands)
      Returns the 'concat' function formatted for a specific SQL dialect.
      Parameters:
      operands - the string expressions to concatenate
      Returns:
      the 'concat' function for a specific SQL dialect.
    • formatLengthFunction

      String formatLengthFunction(String operand)
      Returns the 'length' function formatted for a specific SQL dialect.
      Parameters:
      operand - the string expression to get length of
      Returns:
      the 'length' function for a specific SQL dialect.
    • formatCeilFunction

      String formatCeilFunction(String operand)
      Returns the 'ceil' function formatted for a specific SQL dialect.
      Parameters:
      operand - the numeric expression to get ceiling of
      Returns:
      the 'ceil' function for a specific SQL dialect.
    • formatRoundFunction

      String formatRoundFunction(String operand)
      Returns the 'round' function formatted for a specific SQL dialect.
      Parameters:
      operand - the numeric expression to perform rounding on
      Returns:
      the 'round' function for a specific SQL dialect.
    • formatModuloFunction

      String formatModuloFunction(String divisor, String dividend)
      Returns the 'mod' function formatted for a specific SQL dialect.
      Parameters:
      divisor - the numeric expression for divisor operand
      dividend - the numeric expression for dividend operand
      Returns:
      the 'mod' function for a specific SQL dialect.
    • formatCurrentDateFunction

      String formatCurrentDateFunction()
      Returns the 'current_date' system function formatted for a specific SQL dialect.
      Returns:
      the 'current_date' function for a specific SQL dialect.
    • getConcatOperator

      Optional<String> getConcatOperator()
      Returns the string concatenation operator for a specific SQL Dialect.
      Returns:
      the string concatenation operator for a specific SQL Dialect.
    • supports

      boolean supports(Capability capability)
      Indicates whether a capability is supported by a specific SQL dialect.
      Parameters:
      capability - the capability to check support for
      Returns:
      true if specified capability is supported; else false
    • fromConnection

      static Dialect fromConnection(Connection connection)
      Creates the Dialect instance corresponding to database vendor associated with specified connection.
      Parameters:
      connection - the connection.
      Returns:
      the Dialect instance.