public abstract class

ObjectNameNormalizer

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

Class Overview

Provides centralized normalization of how database object names are handled.

Summary

Nested Classes
interface ObjectNameNormalizer.NamingStrategyHelper Helper contract for dealing with NamingStrategy in different situations. 
Public Constructors
ObjectNameNormalizer()
Public Methods
String normalizeDatabaseIdentifier(String explicitName, ObjectNameNormalizer.NamingStrategyHelper helper)
Performs the actual contract of normalizing a database name.
String normalizeIdentifierQuoting(String identifier)
Allow normalizing of just the quoting aspect of identifiers.
Protected Methods
abstract NamingStrategy getNamingStrategy()
Get the current NamingStrategy.
abstract boolean isUseQuotedIdentifiersGlobally()
Retrieve whether the user requested that all database identifiers be quoted.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ObjectNameNormalizer ()

Public Methods

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.

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.

Protected Methods

protected abstract NamingStrategy getNamingStrategy ()

Get the current NamingStrategy.

Returns

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.