com.holonplatform.datastore.jdbc

## Interface JdbcDialect

- All Superinterfaces:
    Serializable
  All Known Implementing Classes:
    DB2Dialect, DefaultDialect, DerbyDialect, H2Dialect, HANADialect, HSQLDialect, InformixDialect, MariaDBDialect, MySQLDialect, OracleDialect, PostgreSQLDialect, SQLiteDialect, SQLServerDialect

      public interface JdbcDialect
      extends Serializable

  Represents a dialect of SQL implemented by a particular database.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `JdbcDialect.DialectResolutionContext` Dialect resolution context.
    `static interface` | `JdbcDialect.LimitHandler` Handler to apply limit/offset to SQL query.
    `static interface` | `JdbcDialect.SQLFunction` SQL function representation.
    `static interface` | `JdbcDialect.SQLParameterProcessor` Parameter processor for serialized parameters manipulation.
    `static interface` | `JdbcDialect.SQLPathProcessor` Path processor for serialized path manipulation.
    `static interface` | `JdbcDialect.SQLValueDeserializer` SQL query values deserializer
    `static class` | `JdbcDialect.StatementConfigurationException` Exception related to JDBC statement configuration errors.
    `static interface` | `JdbcDialect.StatementConfigurator` JDBC `PreparedStatement` configurator.
    `static interface` | `JdbcDialect.StatementParameterHandler` Handler to manage statement parameters setting.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default boolean` | `deleteStatementAliasSupported()` Get whether alias is supported in the DELETE clause.
    `default boolean` | `deleteStatementTargetRequired()` Get whether the DELETE clause target must be specified.
    `boolean` | `generatedKeyAlwaysReturned()` Retrieves whether a generated key will always be returned if the column name(s) or index(es) specified for the auto generated key column(s) are valid and the statement succeeds.
    `default String` | `getColumnName(String columnName)` Get the actual column name for given column name (for example, applying case transformations)
    `default JdbcDialect.SQLFunction` | `getFunction(String name)` Get the `JdbcDialect.SQLFunction` bound to given symbolic name.
    `default Optional<JdbcDialect.LimitHandler>` | `getLimitHandler()` Get the `JdbcDialect.LimitHandler`
    `default Optional<JdbcDialect.SQLParameterProcessor>` | `getParameterProcessor()` Get the dialect `JdbcDialect.SQLParameterProcessor`.
    `default Optional<JdbcDialect.SQLPathProcessor>` | `getPathProcessor()` Get the dialect `JdbcDialect.SQLPathProcessor`.
    `default Optional<com.holonplatform.core.Path<?>[]>` | `getPrimaryKey(String tableName, Connection connection)` Get the primary key paths for given `tableName`, if available.
    `JdbcDialect.StatementConfigurator` | `getStatementConfigurator()` Get the `JdbcDialect.StatementConfigurator` to use to configure JDBC statements.
    `default Optional<JdbcDialect.StatementParameterHandler>` | `getStatementParameterHandler()` Get the dialect `JdbcDialect.StatementParameterHandler`.
    `default String` | `getTableName(String tableName)` Get the actual table name for given table name (for example, applying case transformations)
    `default JdbcDialect.SQLValueDeserializer` | `getValueDeserializer()` Get the `JdbcDialect.SQLValueDeserializer` to use to deserialize SQL query results.
    `void` | `init(JdbcDatastore datastore)` Dialect initialization hook at parent datastore initialization.
    `default boolean` | `supportGetGeneratedKeyByName()` Retrieves whether auto-generated keys can be retrieved by name after a statement has been executed.
    `boolean` | `supportsGetGeneratedKeys()` Retrieves whether auto-generated keys can be retrieved after a statement has been executed.
    `boolean` | `supportsLikeEscapeClause()` Retrieves whether this database supports specifying a `LIKE` escape clause.
    `default boolean` | `useOuterInJoins()` Get whether to use the `OUTER` keyword in join serialization.

- - ### Method Detail

    - #### init

          void init(JdbcDatastore datastore)
             throws SQLException

      Dialect initialization hook at parent datastore initialization.
      Parameters:
        `datastore` - Parent datastore
      Throws:
        `SQLException` - An error occurred during dialect initialization

    - #### getFunction

          default JdbcDialect.SQLFunction getFunction(String name)

      Get the `JdbcDialect.SQLFunction` bound to given symbolic name.
      Parameters:
        `name` - Function symbolic name
      Returns:
        Optional `JdbcDialect.SQLFunction` bound to given symbolic name. If null, a default function will be used, if available

    - #### useOuterInJoins

          default boolean useOuterInJoins()

      Get whether to use the `OUTER` keyword in join serialization.
      Returns:
        `true` to use the `OUTER` keyword in join serialization

    - #### deleteStatementAliasSupported

          default boolean deleteStatementAliasSupported()

      Get whether alias is supported in the DELETE clause.
      Returns:
        `true` if alias is supported in the DELETE clause

    - #### deleteStatementTargetRequired

          default boolean deleteStatementTargetRequired()

      Get whether the DELETE clause target must be specified.
      Returns:
        `true` if the DELETE clause target must be specified

    - #### getTableName

          default String getTableName(String tableName)

      Get the actual table name for given table name (for example, applying case transformations)
      Parameters:
        `tableName` - Table name
      Returns:
        The actual table name

    - #### getColumnName

          default String getColumnName(String columnName)

      Get the actual column name for given column name (for example, applying case transformations)
      Parameters:
        `columnName` - Column name
      Returns:
        The actual column name

    - #### getValueDeserializer

          default JdbcDialect.SQLValueDeserializer getValueDeserializer()

      Get the `JdbcDialect.SQLValueDeserializer` to use to deserialize SQL query results.
      Returns:
        The SQLValueDeserializer (not null)

    - #### getStatementConfigurator

          JdbcDialect.StatementConfigurator getStatementConfigurator()

      Get the `JdbcDialect.StatementConfigurator` to use to configure JDBC statements.
      Returns:
        The StatementConfigurator (not null)

    - #### getPathProcessor

          default Optional<JdbcDialect.SQLPathProcessor> getPathProcessor()

      Get the dialect `JdbcDialect.SQLPathProcessor`.
      Returns:
        Optional SQLPathProcessor

    - #### getParameterProcessor

          default Optional<JdbcDialect.SQLParameterProcessor> getParameterProcessor()

      Get the dialect `JdbcDialect.SQLParameterProcessor`.
      Returns:
        Optional SQLParameterProcessor

    - #### getStatementParameterHandler

          default Optional<JdbcDialect.StatementParameterHandler> getStatementParameterHandler()

      Get the dialect `JdbcDialect.StatementParameterHandler`.
      Returns:
        Optional StatementParameterHandler

    - #### supportsLikeEscapeClause

          boolean supportsLikeEscapeClause()

      Retrieves whether this database supports specifying a `LIKE` escape clause.
      Returns:
        `true` if so; `false` otherwise

    - #### supportsGetGeneratedKeys

          boolean supportsGetGeneratedKeys()

      Retrieves whether auto-generated keys can be retrieved after a statement has been executed.
      Returns:
        `true` if auto-generated keys can be retrieved after a statement has executed; `false` otherwise

    - #### generatedKeyAlwaysReturned

          boolean generatedKeyAlwaysReturned()

      Retrieves whether a generated key will always be returned if the column name(s) or index(es) specified for the auto generated key column(s) are valid and the statement succeeds. The key that is returned may or may not be based on the column(s) for the auto generated key.
      Returns:
        `true` if so; `false` otherwise

    - #### supportGetGeneratedKeyByName

          default boolean supportGetGeneratedKeyByName()

      Retrieves whether auto-generated keys can be retrieved by name after a statement has been executed.
      Returns:
        `true` if auto-generated keys can be retrieved by name after a statement has executed

    - #### getPrimaryKey

          default Optional<com.holonplatform.core.Path<?>[]> getPrimaryKey(String tableName,
                                                                           Connection connection)
                                                                    throws SQLException

      Get the primary key paths for given `tableName`, if available.
      Parameters:
        `tableName` - Table name
        `connection` - Connection to use
      Returns:
        Table primary key paths, or empty if not available
      Throws:
        `SQLException` - Error during primary key retrieving

    - #### getLimitHandler

          default Optional<JdbcDialect.LimitHandler> getLimitHandler()

      Get the `JdbcDialect.LimitHandler`
      Returns:
        Optional limit handler

Copyright © 2017 The Holon Platform. All rights reserved.