Package org.hibernate.boot.model.naming
Class ImplicitNamingStrategyJpaCompliantImpl
- java.lang.Object
-
- org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
-
- All Implemented Interfaces:
Serializable,ImplicitNamingStrategy
- Direct Known Subclasses:
ImplicitNamingStrategyComponentPathImpl,ImplicitNamingStrategyLegacyHbmImpl,ImplicitNamingStrategyLegacyJpaImpl
public class ImplicitNamingStrategyJpaCompliantImpl extends Object implements ImplicitNamingStrategy, Serializable
Implementation of theImplicitNamingStrategycontract, generally preferring to conform to JPA standards.For the legacy JPA-based naming standards initially implemented by Hibernate, see/use
ImplicitNamingStrategyLegacyJpaImpl- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ImplicitNamingStrategyINSTANCE
-
Constructor Summary
Constructors Constructor Description ImplicitNamingStrategyJpaCompliantImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdentifierdetermineAnyDiscriminatorColumnName(ImplicitAnyDiscriminatorColumnNameSource source)Determine the column name related to the discriminator portion of anAnymapping when no explicit column name is given usingColumn.name().IdentifierdetermineAnyKeyColumnName(ImplicitAnyKeyColumnNameSource source)Determine the join column name related to the key/id portion of anAnymapping when no explicit join column name is given usingJoinColumn.name().IdentifierdetermineBasicColumnName(ImplicitBasicColumnNameSource source)Determine the column name when it is not explicitly specified usingColumn.name().IdentifierdetermineCollectionTableName(ImplicitCollectionTableNameSource source)Determine the name of a collection join table given the source naming information, when a name is not explicitly given.IdentifierdetermineDiscriminatorColumnName(ImplicitDiscriminatorColumnNameSource source)Determine the discriminator column name for the given entity when it is not explicitly specified usingDiscriminatorColumn.name().IdentifierdetermineForeignKeyName(ImplicitForeignKeyNameSource source)Determine the foreign key name when it is not explicitly specified usingForeignKey.name().IdentifierdetermineIdentifierColumnName(ImplicitIdentifierColumnNameSource source)Determine the name if the identifier column belonging to the given entity when it is not explicitly specified usingColumn.name().IdentifierdetermineIndexName(ImplicitIndexNameSource source)Determine the index name when it is not explicitly specified usingIndex.name().IdentifierdetermineJoinColumnName(ImplicitJoinColumnNameSource source)Determine the join column name when it is not explicitly specified usingJoinColumn.name().IdentifierdetermineJoinTableName(ImplicitJoinTableNameSource source)Determine the name of an association join table given the source naming information, when a name is not explicitly given.IdentifierdetermineListIndexColumnName(ImplicitIndexColumnNameSource source)Determine the list index column name when it is not explicitly specified usingOrderColumn.name().IdentifierdetermineMapKeyColumnName(ImplicitMapKeyColumnNameSource source)Determine the map key column name when it is not explicitly specified usingMapKeyColumn.name().IdentifierdeterminePrimaryKeyJoinColumnName(ImplicitPrimaryKeyJoinColumnNameSource source)Determine the primary key join column name when it is not explicitly specified usingPrimaryKeyJoinColumn.name().IdentifierdeterminePrimaryTableName(ImplicitEntityNameSource source)Determine the implicit name of an entity's primary table.IdentifierdetermineTenantIdColumnName(ImplicitTenantIdColumnNameSource source)Determine the implicit name of the tenant identifier column belonging to a given entity when it is not explicitly specified usingColumn.name().IdentifierdetermineUniqueKeyName(ImplicitUniqueKeyNameSource source)Determine the unique key name when it is not explicitly specified usingUniqueConstraint.name().protected IdentifiertoIdentifier(String stringForm, MetadataBuildingContext buildingContext)Easy hook to build an Identifier using the keyword safe IdentifierHelper.protected StringtransformAttributePath(AttributePath attributePath)For JPA standards we typically need the unqualified name.protected StringtransformEntityName(EntityNaming entityNaming)
-
-
-
Field Detail
-
INSTANCE
public static final ImplicitNamingStrategy INSTANCE
-
-
Method Detail
-
determinePrimaryTableName
public Identifier determinePrimaryTableName(ImplicitEntityNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the implicit name of an entity's primary table.- Specified by:
determinePrimaryTableNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The implicit table name.
-
transformEntityName
protected String transformEntityName(EntityNaming entityNaming)
-
determineJoinTableName
public Identifier determineJoinTableName(ImplicitJoinTableNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the name of an association join table given the source naming information, when a name is not explicitly given. This method is called for any sort of association with a join table, no matter what the logical cardinality.- Specified by:
determineJoinTableNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The implicit table name.
-
determineCollectionTableName
public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the name of a collection join table given the source naming information, when a name is not explicitly given. This method is called only for collections of basic or embeddable values, and never for associations.- Specified by:
determineCollectionTableNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The implicit table name.
-
determineIdentifierColumnName
public Identifier determineIdentifierColumnName(ImplicitIdentifierColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the name if the identifier column belonging to the given entity when it is not explicitly specified usingColumn.name().- Specified by:
determineIdentifierColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The determined identifier column name
-
determineDiscriminatorColumnName
public Identifier determineDiscriminatorColumnName(ImplicitDiscriminatorColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the discriminator column name for the given entity when it is not explicitly specified usingDiscriminatorColumn.name().- Specified by:
determineDiscriminatorColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The implicit discriminator column name
-
determineTenantIdColumnName
public Identifier determineTenantIdColumnName(ImplicitTenantIdColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the implicit name of the tenant identifier column belonging to a given entity when it is not explicitly specified usingColumn.name().- Specified by:
determineTenantIdColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The determined tenant identifier column name
-
determineBasicColumnName
public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the column name when it is not explicitly specified usingColumn.name().- Specified by:
determineBasicColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The implicit column name.
-
determineJoinColumnName
public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the join column name when it is not explicitly specified usingJoinColumn.name().In
hbm.xmlterms, this would be a<key/>defined for a collection or the column associated with a many-to-one.- Specified by:
determineJoinColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The determined join column name
-
determinePrimaryKeyJoinColumnName
public Identifier determinePrimaryKeyJoinColumnName(ImplicitPrimaryKeyJoinColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the primary key join column name when it is not explicitly specified usingPrimaryKeyJoinColumn.name().In
hbm.xmlterms, this would be a<key/>defined for a<join/>or a<joined-subclass/>.- Specified by:
determinePrimaryKeyJoinColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The determined column name
-
determineAnyDiscriminatorColumnName
public Identifier determineAnyDiscriminatorColumnName(ImplicitAnyDiscriminatorColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the column name related to the discriminator portion of anAnymapping when no explicit column name is given usingColumn.name().- Specified by:
determineAnyDiscriminatorColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The determined column name
-
determineAnyKeyColumnName
public Identifier determineAnyKeyColumnName(ImplicitAnyKeyColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the join column name related to the key/id portion of anAnymapping when no explicit join column name is given usingJoinColumn.name().- Specified by:
determineAnyKeyColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The determined identifier column name
-
determineMapKeyColumnName
public Identifier determineMapKeyColumnName(ImplicitMapKeyColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the map key column name when it is not explicitly specified usingMapKeyColumn.name().- Specified by:
determineMapKeyColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The implicit column name.
-
determineListIndexColumnName
public Identifier determineListIndexColumnName(ImplicitIndexColumnNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the list index column name when it is not explicitly specified usingOrderColumn.name().- Specified by:
determineListIndexColumnNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The implicit column name.
-
determineForeignKeyName
public Identifier determineForeignKeyName(ImplicitForeignKeyNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the foreign key name when it is not explicitly specified usingForeignKey.name().- Specified by:
determineForeignKeyNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The determined foreign key name
-
determineUniqueKeyName
public Identifier determineUniqueKeyName(ImplicitUniqueKeyNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the unique key name when it is not explicitly specified usingUniqueConstraint.name().- Specified by:
determineUniqueKeyNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The determined foreign key name
-
determineIndexName
public Identifier determineIndexName(ImplicitIndexNameSource source)
Description copied from interface:ImplicitNamingStrategyDetermine the index name when it is not explicitly specified usingIndex.name().- Specified by:
determineIndexNamein interfaceImplicitNamingStrategy- Parameters:
source- The source information- Returns:
- The determined foreign key name
-
transformAttributePath
protected String transformAttributePath(AttributePath attributePath)
For JPA standards we typically need the unqualified name. However, a more usable impl tends to use the whole path. This method provides an easy hook for subclasses to accomplish that- Parameters:
attributePath- The attribute path- Returns:
- The extracted name
-
toIdentifier
protected Identifier toIdentifier(String stringForm, MetadataBuildingContext buildingContext)
Easy hook to build an Identifier using the keyword safe IdentifierHelper.- Parameters:
stringForm- The String form of the namebuildingContext- Access to the IdentifierHelper- Returns:
- The identifier
-
-