Interface IdentifierHelper

All Known Implementing Classes:
DelegatingIdentifierHelper

@SPI({USE,SUPPLY}) public interface IdentifierHelper

Handles configured database identifiers at runtime.

A Dialect provider uses this helper after Hibernate has applied identifier casing, keyword, quoting, and namespace configuration. Configure the boot-scoped builder received by IdentifierSupport.buildIdentifierHelper(IdentifierHelperBuildRequest) before invoking the inherited build operation. When builder configuration cannot express a database rule, decorate the resulting helper with DelegatingIdentifierHelper. Do not implement this interface directly as a provider contract.

See Also:
  • Method Details

    • normalizeQuoting

      Identifier normalizeQuoting(Identifier identifier)
      Quote the identifier when required by the configured global, reserved-word, or database-specific policy.
      Parameters:
      identifier - the identifier to normalize
      Returns:
      the quoting-normalized identifier
    • toIdentifier

      Identifier toIdentifier(String text)
      Create an identifier from mapping text, applying configured implicit quoting when necessary.
      Parameters:
      text - the name obtained from mapping information
      Returns:
      the identifier form of the name
    • toIdentifier

      Identifier toIdentifier(String text, boolean quoted)
      Create an identifier from mapping text, honoring explicit quoting and then applying configured implicit quoting when necessary.
      Parameters:
      text - the name obtained from mapping information
      quoted - whether the identifier is explicitly quoted
      Returns:
      the identifier form of the name
    • toIdentifier

      Identifier toIdentifier(String text, boolean quoted, boolean isExplicit)
      Create an identifier from mapping text while retaining whether the mapping supplied the name explicitly.
      Parameters:
      text - the name obtained from mapping information
      quoted - whether the identifier is explicitly quoted
      isExplicit - whether the mapping supplied the name explicitly
      Returns:
      the identifier form of the name
    • applyGlobalQuoting

      Identifier applyGlobalQuoting(String text)

      Apply global quoting to a column-definition fragment as required by Jakarta Persistence. Do not use this operation for ordinary identifiers.

      Applications may exclude column definitions from global quoting through MappingSettings.GLOBALLY_QUOTED_IDENTIFIERS_SKIP_COLUMN_DEFINITIONS.

      Parameters:
      text - the text to quote when global policy requires it
      Returns:
      the identifier form
    • isReservedWord

      boolean isReservedWord(String word)
      Determine whether the configured environment treats a word as reserved.
      Parameters:
      word - the word to check
      Returns:
      true when the word is reserved
    • toMetaDataCatalogName

      String toMetaDataCatalogName(Identifier catalogIdentifier)
      Render a catalog identifier for java.sql.DatabaseMetaData calls.
      Parameters:
      catalogIdentifier - the catalog identifier, or null for the configured current-catalog behavior
      Returns:
      the JDBC metadata catalog name
    • toMetaDataSchemaName

      String toMetaDataSchemaName(Identifier schemaIdentifier)
      Render a schema identifier for java.sql.DatabaseMetaData calls.
      Parameters:
      schemaIdentifier - the schema identifier, or null for the configured current-schema behavior
      Returns:
      the JDBC metadata schema name
    • toMetaDataObjectName

      String toMetaDataObjectName(Identifier identifier)
      Render a required database-object identifier for java.sql.DatabaseMetaData calls.
      Parameters:
      identifier - the required object identifier
      Returns:
      the JDBC metadata object name