Class DelegatingIdentifierHelper

java.lang.Object
org.hibernate.dialect.identifier.spi.DelegatingIdentifierHelper
All Implemented Interfaces:
IdentifierHelper

@SPI({USE,IMPLEMENT}) public abstract class DelegatingIdentifierHelper extends Object implements IdentifierHelper

Supported base for selectively decorating a configured identifier helper.

First configure the builder received by IdentifierSupport.buildIdentifierHelper(IdentifierHelperBuildRequest) and invoke the inherited build operation. Extend this class only when the resulting helper requires a database-specific rule which builder configuration cannot express. Override every related entry point which must apply that rule; each inherited operation forwards independently.

Call super to preserve ordinary forwarding or use delegate() when an override must invoke a different delegate operation. Retaining the delegate as part of the returned runtime helper is supported. Do not retain the boot-scoped build request, builder, or metadata view.

Since:
8.0
See Also:
  • Constructor Details

    • DelegatingIdentifierHelper

      @SPI(IMPLEMENT) protected DelegatingIdentifierHelper(IdentifierHelper delegate)
      Create a decorator around the non-null configured helper.
      Since:
      8.0
  • Method Details

    • delegate

      @SPI(USE) protected final IdentifierHelper delegate()
      Access the stable configured helper owned by this decorator.
      Since:
      8.0
    • normalizeQuoting

      @SPI({USE,IMPLEMENT}) public Identifier normalizeQuoting(Identifier identifier)
      Description copied from interface: IdentifierHelper
      Quote the identifier when required by the configured global, reserved-word, or database-specific policy.
      Specified by:
      normalizeQuoting in interface IdentifierHelper
      Parameters:
      identifier - the identifier to normalize
      Returns:
      the quoting-normalized identifier
    • toIdentifier

      @SPI({USE,IMPLEMENT}) public Identifier toIdentifier(String text)
      Description copied from interface: IdentifierHelper
      Create an identifier from mapping text, applying configured implicit quoting when necessary.
      Specified by:
      toIdentifier in interface IdentifierHelper
      Parameters:
      text - the name obtained from mapping information
      Returns:
      the identifier form of the name
    • toIdentifier

      @SPI({USE,IMPLEMENT}) public Identifier toIdentifier(String text, boolean quoted)
      Description copied from interface: IdentifierHelper
      Create an identifier from mapping text, honoring explicit quoting and then applying configured implicit quoting when necessary.
      Specified by:
      toIdentifier in interface IdentifierHelper
      Parameters:
      text - the name obtained from mapping information
      quoted - whether the identifier is explicitly quoted
      Returns:
      the identifier form of the name
    • toIdentifier

      @SPI({USE,IMPLEMENT}) public Identifier toIdentifier(String text, boolean quoted, boolean isExplicit)
      Description copied from interface: IdentifierHelper
      Create an identifier from mapping text while retaining whether the mapping supplied the name explicitly.
      Specified by:
      toIdentifier in interface IdentifierHelper
      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

      @SPI({USE,IMPLEMENT}) public Identifier applyGlobalQuoting(String text)
      Description copied from interface: IdentifierHelper

      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.

      Specified by:
      applyGlobalQuoting in interface IdentifierHelper
      Parameters:
      text - the text to quote when global policy requires it
      Returns:
      the identifier form
    • isReservedWord

      @SPI({USE,IMPLEMENT}) public boolean isReservedWord(String word)
      Description copied from interface: IdentifierHelper
      Determine whether the configured environment treats a word as reserved.
      Specified by:
      isReservedWord in interface IdentifierHelper
      Parameters:
      word - the word to check
      Returns:
      true when the word is reserved
    • toMetaDataCatalogName

      @SPI({USE,IMPLEMENT}) public String toMetaDataCatalogName(Identifier catalogIdentifier)
      Description copied from interface: IdentifierHelper
      Render a catalog identifier for java.sql.DatabaseMetaData calls.
      Specified by:
      toMetaDataCatalogName in interface IdentifierHelper
      Parameters:
      catalogIdentifier - the catalog identifier, or null for the configured current-catalog behavior
      Returns:
      the JDBC metadata catalog name
    • toMetaDataSchemaName

      @SPI({USE,IMPLEMENT}) public String toMetaDataSchemaName(Identifier schemaIdentifier)
      Description copied from interface: IdentifierHelper
      Render a schema identifier for java.sql.DatabaseMetaData calls.
      Specified by:
      toMetaDataSchemaName in interface IdentifierHelper
      Parameters:
      schemaIdentifier - the schema identifier, or null for the configured current-schema behavior
      Returns:
      the JDBC metadata schema name
    • toMetaDataObjectName

      @SPI({USE,IMPLEMENT}) public String toMetaDataObjectName(Identifier identifier)
      Description copied from interface: IdentifierHelper
      Render a required database-object identifier for java.sql.DatabaseMetaData calls.
      Specified by:
      toMetaDataObjectName in interface IdentifierHelper
      Parameters:
      identifier - the required object identifier
      Returns:
      the JDBC metadata object name