Class ObjectNameNormalizer

java.lang.Object
org.hibernate.cfg.ObjectNameNormalizer

public abstract class ObjectNameNormalizer extends Object
Provides centralized normalization of how database object names are handled.
  • Constructor Details

    • ObjectNameNormalizer

      public ObjectNameNormalizer()
  • Method Details

    • normalizeDatabaseIdentifier

      public String normalizeDatabaseIdentifier(String explicitName, ObjectNameNormalizer.NamingStrategyHelper helper)
      Performs the actual contract of normalizing a database name.
      Parameters:
      explicitName - The name the user explicitly gave for the database object.
      helper - The NamingStrategy helper.
      Returns:
      The normalized identifier.
    • normalizeIdentifierQuoting

      public String normalizeIdentifierQuoting(String identifier)
      Allow normalizing of just the quoting aspect of identifiers. This is useful for schema and catalog in terms of initially making this public.

      This implements the rules set forth in JPA 2 (section "2.13 Naming of Database Objects") which states that the double-quote (") is the character which should be used to denote a quoted identifier. Here, we handle recognizing that and converting it to the more elegant bactick (`) approach used in Hibernate.. Additionally we account for applying what JPA2 terms

      Parameters:
      identifier - The identifier to be quoting-normalized.
      Returns:
      The identifier accounting for any quoting that need be applied.
    • isUseQuotedIdentifiersGlobally

      protected abstract boolean isUseQuotedIdentifiersGlobally()
      Retrieve whether the user requested that all database identifiers be quoted.
      Returns:
      True if the user requested that all database identifiers be quoted, false otherwise.
    • getNamingStrategy

      protected abstract NamingStrategy getNamingStrategy()
      Get the current NamingStrategy.
      Returns:
      The current NamingStrategy.