类 ObjectNameNormalizer
- java.lang.Object
-
- org.hibernate.boot.model.naming.ObjectNameNormalizer
-
public abstract class ObjectNameNormalizer extends Object
Provides centralized normalization of how database object names are handled.- 作者:
- Steve Ebersole
-
-
构造器概要
构造器 构造器 说明 ObjectNameNormalizer()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 StringapplyGlobalQuoting(String text)Intended only for use in handling quoting requirements forcolumn-definitionas defined byColumn.columnDefinition(),JoinColumn.columnDefinition(), etc.protected Databasedatabase()IdentifierdetermineLogicalName(String explicitName, NamingStrategyHelper namingStrategyHelper)Determine the logical name give a (potentiallynull/empty) explicit name.protected abstract MetadataBuildingContextgetBuildingContext()Access the contextual information related to the current process of building metadata.IdentifiernormalizeIdentifierQuoting(String identifierText)Normalizes the quoting of identifiers.IdentifiernormalizeIdentifierQuoting(Identifier identifier)StringnormalizeIdentifierQuotingAsString(String identifierText)Normalizes the quoting of identifiers.StringtoDatabaseIdentifierText(String identifierText)
-
-
-
方法详细资料
-
normalizeIdentifierQuoting
public Identifier normalizeIdentifierQuoting(String identifierText)
Normalizes the quoting of identifiers. 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 backtick (`) approach used in Hibernate.. Additionally we account for applying what JPA2 terms "globally quoted identifiers".- 参数:
identifierText- The identifier to be quoting-normalized.- 返回:
- The identifier accounting for any quoting that need be applied.
-
database
protected Database database()
-
normalizeIdentifierQuoting
public Identifier normalizeIdentifierQuoting(Identifier identifier)
-
normalizeIdentifierQuotingAsString
public String normalizeIdentifierQuotingAsString(String identifierText)
Normalizes the quoting of identifiers. This form returns a String rather than an Identifier to better work with the legacy code inorg.hibernate.mapping- 参数:
identifierText- The identifier to be quoting-normalized.- 返回:
- The identifier accounting for any quoting that need be applied.
-
determineLogicalName
public Identifier determineLogicalName(String explicitName, NamingStrategyHelper namingStrategyHelper)
Determine the logical name give a (potentiallynull/empty) explicit name.- 参数:
explicitName- The explicit, user-supplied namenamingStrategyHelper- The naming strategy helper.- 返回:
- The logical name
-
applyGlobalQuoting
public String applyGlobalQuoting(String text)
Intended only for use in handling quoting requirements forcolumn-definitionas defined byColumn.columnDefinition(),JoinColumn.columnDefinition(), etc. This method should not be called in any other scenario.- 参数:
text- The specified column definition- 返回:
- The name with global quoting applied
-
getBuildingContext
protected abstract MetadataBuildingContext getBuildingContext()
Access the contextual information related to the current process of building metadata. Here, that typically might be needed for accessing:- 返回:
- The current building context
-
-