com.holonplatform.datastore.jpa.dialect

## Interface ORMDialect

- All Known Implementing Classes:
    DatanucleusDialect, DefaultDialect, EclipselinkDialect, HibernateDialect, OpenJPADialect

      public interface ORMDialect

  JPA ORM dialect.
  Since:
    5.1.0

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ORMDialect` | `datanucleus()` Obtain the Datanucleus ORM dialect implementation.
    `default boolean` | `deleteStatementAliasSupported()` Get whether alias is supported in DELETE statements.
    `static Optional<ORMDialect>` | `detect(ORMPlatform platform)` Detect a suitable `ORMDialect` to use with given ORM platform, if available.
    `static ORMDialect` | `eclipselink()` Obtain the Eclipselink ORM dialect implementation.
    `default Optional<String>` | `getBatchSizeConfigurationProperty()` Get the JPA configuration property name which corresponds to bulk operations batch size.
    `default char` | `getLikeEscapeCharacter()` Get the character to use for ESCAPE in LIKE predicate.
    `default String` | `getLikeEscapeJPQL(char escapeCharacter)` Serialize LIKE ESCAPE character as JPQL.
    `int` | `getSupportedJPAMajorVersion()` Get the supported JPA major version.
    `int` | `getSupportedJPAMinorVersion()` Get the supported JPA minor version.
    `static ORMDialect` | `hibernate()` Obtain the Hibernate ORM dialect implementation.
    `void` | `init(ORMDialectContext context)` Dialect initialization hook at parent datastore initialization.
    `boolean` | `isTupleSupported()` Returns whether the `Tuple` query result type is supported.
    `default boolean` | `likeEscapeSupported()` Get whether the ESCAPE clause in LIKE predicate is supported.
    `static ORMDialect` | `openJPA()` Obtain the OpenJPA ORM dialect implementation.
    `default Optional<JPQLFunction>` | `resolveFunction(com.holonplatform.core.query.QueryFunction<?,?> function)` Resolve given `function` into a dialect-specific `JPQLFunction`.
    `default boolean` | `temporalTypeParametersSupported()` Get whether `Temporal` type query parameters are supported.
    `default boolean` | `temporalTypeProjectionSupported()` Get whether `Temporal` type query result is supported.
    `default com.holonplatform.core.exceptions.DataAccessException` | `translateException(javax.persistence.PersistenceException exception)` Translates given `PersistenceException` into a suitable `DataAccessException`.
    `default boolean` | `updateStatementAliasSupported()` Get whether alias is supported in UPDATE statements.
    `default boolean` | `updateStatementSetAliasSupported()` Get whether alias is supported in UPDATE statement SET clause.

- - ### Method Detail

    - #### init

          void init(ORMDialectContext context)

      Dialect initialization hook at parent datastore initialization.
      Parameters:
        `context` - Dialect context

    - #### getSupportedJPAMajorVersion

          int getSupportedJPAMajorVersion()

      Get the supported JPA major version.
      Returns:
        the supported JPA major version

    - #### getSupportedJPAMinorVersion

          int getSupportedJPAMinorVersion()

      Get the supported JPA minor version.
      Returns:
        the supported JPA minor version

    - #### isTupleSupported

          boolean isTupleSupported()

      Returns whether the `Tuple` query result type is supported.
      Returns:
        Whether the `Tuple` query result type is supported

    - #### getBatchSizeConfigurationProperty

          default Optional<String> getBatchSizeConfigurationProperty()

      Get the JPA configuration property name which corresponds to bulk operations batch size.
      Returns:
        The batch size configuration property name, if available

    - #### temporalTypeParametersSupported

          default boolean temporalTypeParametersSupported()

      Get whether `Temporal` type query parameters are supported.
      Returns:
        Whether `Temporal` type query parameters are supported

    - #### temporalTypeProjectionSupported

          default boolean temporalTypeProjectionSupported()

      Get whether `Temporal` type query result is supported.
      Returns:
        Whether `Temporal` type query result is supported

    - #### updateStatementAliasSupported

          default boolean updateStatementAliasSupported()

      Get whether alias is supported in UPDATE statements.
      Returns:
        Whether alias is supported in UPDATE statements.

    - #### updateStatementSetAliasSupported

          default boolean updateStatementSetAliasSupported()

      Get whether alias is supported in UPDATE statement SET clause.
      Returns:
        Whether alias is supported in UPDATE statement SET clause.

    - #### deleteStatementAliasSupported

          default boolean deleteStatementAliasSupported()

      Get whether alias is supported in DELETE statements.
      Returns:
        Whether alias is supported in DELETE statements.

    - #### likeEscapeSupported

          default boolean likeEscapeSupported()

      Get whether the ESCAPE clause in LIKE predicate is supported.
      Returns:
        Whether the ESCAPE clause in LIKE predicate is supported.

    - #### getLikeEscapeCharacter

          default char getLikeEscapeCharacter()

      Get the character to use for ESCAPE in LIKE predicate.
      Returns:
        the character to use for ESCAPE in LIKE predicate.

    - #### getLikeEscapeJPQL

          default String getLikeEscapeJPQL(char escapeCharacter)

      Serialize LIKE ESCAPE character as JPQL.
      Parameters:
        `escapeCharacter` - The LIKE ESCAPE character to use
      Returns:
        JPQL expression

    - #### resolveFunction

          default Optional<JPQLFunction> resolveFunction(com.holonplatform.core.query.QueryFunction<?,?> function)

      Resolve given `function` into a dialect-specific `JPQLFunction`.
      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

    - #### translateException

          default com.holonplatform.core.exceptions.DataAccessException translateException(javax.persistence.PersistenceException exception)

      Translates given `PersistenceException` into a suitable `DataAccessException`.
      Parameters:
        `exception` - Exception to translate (not null)
      Returns:
        Translated `PersistenceException`

    - #### detect

          static Optional<ORMDialect> detect(ORMPlatform platform)

      Detect a suitable `ORMDialect` to use with given ORM platform, if available.
      Parameters:
        `platform` - ORM platform
      Returns:
        Optional `ORMDialect` for given platform

    - #### hibernate

          static ORMDialect hibernate()

      Obtain the Hibernate ORM dialect implementation.
      Returns:
        A new `ORMDialect` instance

    - #### eclipselink

          static ORMDialect eclipselink()

      Obtain the Eclipselink ORM dialect implementation.
      Returns:
        A new `ORMDialect` instance

    - #### openJPA

          static ORMDialect openJPA()

      Obtain the OpenJPA ORM dialect implementation.
      Returns:
        A new `ORMDialect` instance

    - #### datanucleus

          static ORMDialect datanucleus()

      Obtain the Datanucleus ORM dialect implementation.
      Returns:
        A new `ORMDialect` instance

Copyright © 2019 The Holon Platform. All rights reserved.