com.holonplatform.datastore.jdbc.composer.dialect

## Class SQLServerDialect

- java.lang.Object
- - com.holonplatform.datastore.jdbc.composer.dialect.SQLServerDialect

- All Implemented Interfaces:
    SQLDialect, Serializable

      public class SQLServerDialect
      extends Object
      implements SQLDialect

  MSSQL `SQLDialect`.
  Since:
    5.1.0
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.datastore.jdbc.composer.SQLDialect

      `SQLDialect.LimitHandler`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SQLServerDialect()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `deleteStatementAliasSupported()` Get whether alias is supported in the DELETE clause.
    `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.
    `Optional<SQLDialect.LimitHandler>` | `getLimitHandler()` Get the `SQLDialect.LimitHandler`
    `Optional<String>` | `getLockClause(com.holonplatform.core.query.lock.LockMode mode, long timeout)` Get the SQL lock clause for given lock condition.
    `Optional<String>` | `getLockHint(com.holonplatform.core.query.lock.LockMode mode, long timeout)` Get the SQL lock hint to append to the FROM clause for given lock condition.
    `void` | `init(SQLDialectContext context)` Dialect initialization hook at parent datastore initialization.
    `Optional<SQLFunction>` | `resolveFunction(com.holonplatform.core.query.QueryFunction<?,?> function)` Resolve given `function` into a dialect-specific `SQLFunction`.
    `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.
    `com.holonplatform.core.exceptions.DataAccessException` | `translateException(SQLException exception)` Translates given `SQLException` into a suitable `DataAccessException`.
    `boolean` | `updateStatementFromSupported()` Get whether a FROM clause is supported in the UPDATE clause.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.datastore.jdbc.composer.SQLDialect

      `db2, derby, detect, getColumnName, getJavaType, getSqlType, getTableName, h2, HANA, hsqldb, informix, mariaDB, mySQL, oracle, postgreSQL, sqlite, sqlServer, supportGetGeneratedKeyByName, supportsBinaryStreamParameter, supportsSqlType, updateStatementAliasSupported, updateStatementSetAliasSupported, useOuterInJoins`

- - ### Constructor Detail

    - #### SQLServerDialect

          public SQLServerDialect()

  - ### Method Detail

    - #### init

          public void init(SQLDialectContext context)
                    throws SQLException

      Description copied from interface: `SQLDialect`
      Dialect initialization hook at parent datastore initialization.
      Specified by:
        `init` in interface `SQLDialect`
      Parameters:
        `context` - Dialect context
      Throws:
        `SQLException` - An error occurred during dialect initialization

    - #### resolveFunction

          public Optional<SQLFunction> resolveFunction(com.holonplatform.core.query.QueryFunction<?,?> function)

      Description copied from interface: `SQLDialect`
      Resolve given `function` into a dialect-specific `SQLFunction`.
      Specified by:
        `resolveFunction` in interface `SQLDialect`
      Parameters:
        `function` - The function to resolve (not null)
      Returns:
        A dialect-specific function resolution, or empty to fallback to the default function resolution, if available

    - #### updateStatementFromSupported

          public boolean updateStatementFromSupported()

      Description copied from interface: `SQLDialect`
      Get whether a FROM clause is supported in the UPDATE clause.
      Specified by:
        `updateStatementFromSupported` in interface `SQLDialect`
      Returns:
        `true` if a FROM clause is supported in the UPDATE clause

    - #### supportsLikeEscapeClause

          public boolean supportsLikeEscapeClause()

      Description copied from interface: `SQLDialect`
      Retrieves whether this database supports specifying a `LIKE` escape clause.
      Specified by:
        `supportsLikeEscapeClause` in interface `SQLDialect`
      Returns:
        `true` if so; `false` otherwise

    - #### supportsGetGeneratedKeys

          public boolean supportsGetGeneratedKeys()

      Description copied from interface: `SQLDialect`
      Retrieves whether auto-generated keys can be retrieved after a statement has been executed.
      Specified by:
        `supportsGetGeneratedKeys` in interface `SQLDialect`
      Returns:
        `true` if auto-generated keys can be retrieved after a statement has executed; `false` otherwise

    - #### generatedKeyAlwaysReturned

          public boolean generatedKeyAlwaysReturned()

      Description copied from interface: `SQLDialect`
      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.
      Specified by:
        `generatedKeyAlwaysReturned` in interface `SQLDialect`
      Returns:
        `true` if so; `false` otherwise

    - #### deleteStatementAliasSupported

          public boolean deleteStatementAliasSupported()

      Description copied from interface: `SQLDialect`
      Get whether alias is supported in the DELETE clause.
      Specified by:
        `deleteStatementAliasSupported` in interface `SQLDialect`
      Returns:
        `true` if alias is supported in the DELETE clause

    - #### deleteStatementTargetRequired

          public boolean deleteStatementTargetRequired()

      Description copied from interface: `SQLDialect`
      Get whether the DELETE clause target must be specified.
      Specified by:
        `deleteStatementTargetRequired` in interface `SQLDialect`
      Returns:
        `true` if the DELETE clause target must be specified

    - #### getLockClause

          public Optional<String> getLockClause(com.holonplatform.core.query.lock.LockMode mode,
                                                long timeout)

      Description copied from interface: `SQLDialect`
      Get the SQL lock clause for given lock condition.
      Specified by:
        `getLockClause` in interface `SQLDialect`
      Parameters:
        `mode` - Lock mode
        `timeout` - Lock timeout in milliseconds
      Returns:
        Optional SQL lock clause

    - #### getLockHint

          public Optional<String> getLockHint(com.holonplatform.core.query.lock.LockMode mode,
                                              long timeout)

      Description copied from interface: `SQLDialect`
      Get the SQL lock hint to append to the FROM clause for given lock condition.
      Specified by:
        `getLockHint` in interface `SQLDialect`
      Parameters:
        `mode` - Lock mode
        `timeout` - Lock timeout in milliseconds
      Returns:
        Optional SQL lock hint

    - #### translateException

          public com.holonplatform.core.exceptions.DataAccessException translateException(SQLException exception)

      Description copied from interface: `SQLDialect`
      Translates given `SQLException` into a suitable `DataAccessException`.
      Specified by:
        `translateException` in interface `SQLDialect`
      Parameters:
        `exception` - Exception to translate (not null)
      Returns:
        Translated `DataAccessException`

    - #### getLimitHandler

          public Optional<SQLDialect.LimitHandler> getLimitHandler()

      Description copied from interface: `SQLDialect`
      Get the `SQLDialect.LimitHandler`
      Specified by:
        `getLimitHandler` in interface `SQLDialect`
      Returns:
        Optional limit handler

Copyright © 2019 The Holon Platform. All rights reserved.