com.holonplatform.datastore.jdbc.composer.dialect

## Class MySQLDialect

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

- All Implemented Interfaces:
    SQLDialect, Serializable

      public class MySQLDialect
      extends Object
      implements SQLDialect

  MySQL `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
    `MySQLDialect()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `void` | `init(SQLDialectContext context)` Dialect initialization hook at parent datastore initialization.
    `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.
    `boolean` | `useOuterInJoins()` Get whether to use the `OUTER` keyword in join serialization.

    - ### 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, deleteStatementAliasSupported, derby, detect, getColumnName, getJavaType, getLockHint, getSqlType, getTableName, h2, HANA, hsqldb, informix, mariaDB, mySQL, oracle, postgreSQL, resolveFunction, sqlite, sqlServer, supportGetGeneratedKeyByName, supportsBinaryStreamParameter, supportsSqlType, updateStatementAliasSupported, updateStatementSetAliasSupported`

- - ### Constructor Detail

    - #### MySQLDialect

          public MySQLDialect()

  - ### 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

    - #### 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

    - #### useOuterInJoins

          public boolean useOuterInJoins()

      Description copied from interface: `SQLDialect`
      Get whether to use the `OUTER` keyword in join serialization.
      Specified by:
        `useOuterInJoins` in interface `SQLDialect`
      Returns:
        `true` to use the `OUTER` keyword in join serialization

    - #### 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

    - #### 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.