Package org.hibernate.boot.model.naming
Class ImplicitNamingStrategyJpaCompliantImpl
- java.lang.Object
-
- org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
-
- All Implemented Interfaces:
java.io.Serializable
,ImplicitNamingStrategy
- Direct Known Subclasses:
ImplicitNamingStrategyComponentPathImpl
,ImplicitNamingStrategyLegacyHbmImpl
,ImplicitNamingStrategyLegacyJpaImpl
public class ImplicitNamingStrategyJpaCompliantImpl extends java.lang.Object implements ImplicitNamingStrategy, java.io.Serializable
Implementation of the ImplicitNamingStrategy contract, generally preferring to conform to JPA standards. For the legacy JPA-based naming standards initially implemented by Hibernate, see/useImplicitNamingStrategyLegacyJpaImpl
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ImplicitNamingStrategy
INSTANCE
-
Constructor Summary
Constructors Constructor Description ImplicitNamingStrategyJpaCompliantImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Identifier
determineAnyDiscriminatorColumnName(ImplicitAnyDiscriminatorColumnNameSource source)
Determine the column name related to the discriminator portion of an ANY mapping when no explicit column name is given.Identifier
determineAnyKeyColumnName(ImplicitAnyKeyColumnNameSource source)
Determine the column name related to the key/id portion of an ANY mapping when no explicit column name is given.Identifier
determineBasicColumnName(ImplicitBasicColumnNameSource source)
Determine the name of an attribute's column given the source naming information, when a name is not explicitly given.Identifier
determineCollectionTableName(ImplicitCollectionTableNameSource source)
Determine the name of a collection join table given the source naming information, when a name is not explicitly given.Identifier
determineDiscriminatorColumnName(ImplicitDiscriminatorColumnNameSource source)
Determine the implicit name for the discriminator column for the given entityIdentifier
determineForeignKeyName(ImplicitForeignKeyNameSource source)
Identifier
determineIdentifierColumnName(ImplicitIdentifierColumnNameSource source)
Determine the implicit name for the identifier column for the given entityIdentifier
determineIndexName(ImplicitIndexNameSource source)
Identifier
determineJoinColumnName(ImplicitJoinColumnNameSource source)
Determine the column name related toJoinColumn
.Identifier
determineJoinTableName(ImplicitJoinTableNameSource source)
Determine the name of an association join table given the source naming information, when a name is not explicitly given.Identifier
determineListIndexColumnName(ImplicitIndexColumnNameSource source)
Identifier
determineMapKeyColumnName(ImplicitMapKeyColumnNameSource source)
Identifier
determinePrimaryKeyJoinColumnName(ImplicitPrimaryKeyJoinColumnNameSource source)
Determine the column name related toPrimaryKeyJoinColumn
.Identifier
determinePrimaryTableName(ImplicitEntityNameSource source)
Determine the implicit name of an entity's primary table.Identifier
determineTenantIdColumnName(ImplicitTenantIdColumnNameSource source)
Determine the implicit name for the tenant (multi-tenancy) identifier column for the given entityIdentifier
determineUniqueKeyName(ImplicitUniqueKeyNameSource source)
protected Identifier
toIdentifier(java.lang.String stringForm, MetadataBuildingContext buildingContext)
Easy hook to build an Identifier using the keyword safe IdentifierHelper.protected java.lang.String
transformAttributePath(AttributePath attributePath)
For JPA standards we typically need the unqualified name.protected java.lang.String
transformEntityName(EntityNaming entityNaming)
-
-
-
Field Detail
-
INSTANCE
public static final ImplicitNamingStrategy INSTANCE
-
-
Method Detail
-
determinePrimaryTableName
public Identifier determinePrimaryTableName(ImplicitEntityNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the implicit name of an entity's primary table.- Specified by:
determinePrimaryTableName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The implicit table name.
-
transformEntityName
protected java.lang.String transformEntityName(EntityNaming entityNaming)
-
determineJoinTableName
public Identifier determineJoinTableName(ImplicitJoinTableNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the name of an association join table given the source naming information, when a name is not explicitly given.- Specified by:
determineJoinTableName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The implicit table name.
-
determineCollectionTableName
public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the name of a collection join table given the source naming information, when a name is not explicitly given.- Specified by:
determineCollectionTableName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The implicit table name.
-
determineIdentifierColumnName
public Identifier determineIdentifierColumnName(ImplicitIdentifierColumnNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the implicit name for the identifier column for the given entity- Specified by:
determineIdentifierColumnName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The determined identifier column name
-
determineDiscriminatorColumnName
public Identifier determineDiscriminatorColumnName(ImplicitDiscriminatorColumnNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the implicit name for the discriminator column for the given entity- Specified by:
determineDiscriminatorColumnName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The implicit discriminator column name
-
determineTenantIdColumnName
public Identifier determineTenantIdColumnName(ImplicitTenantIdColumnNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the implicit name for the tenant (multi-tenancy) identifier column for the given entity- Specified by:
determineTenantIdColumnName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The determined tenant identifier column name
-
determineBasicColumnName
public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the name of an attribute's column given the source naming information, when a name is not explicitly given.- Specified by:
determineBasicColumnName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The implicit column name.
-
determineJoinColumnName
public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the column name related toJoinColumn
. Inhbm.xml
terms, this would be a<key/>
defined for a collection or the column associated with a many-to-one.- Specified by:
determineJoinColumnName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The determined join column name
-
determinePrimaryKeyJoinColumnName
public Identifier determinePrimaryKeyJoinColumnName(ImplicitPrimaryKeyJoinColumnNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the column name related toPrimaryKeyJoinColumn
. Inhbm.xml
terms, this would be a<key/>
defined for a<join/>
or a<joined-subclass/>
(others?)- Specified by:
determinePrimaryKeyJoinColumnName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The determined column name
-
determineAnyDiscriminatorColumnName
public Identifier determineAnyDiscriminatorColumnName(ImplicitAnyDiscriminatorColumnNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the column name related to the discriminator portion of an ANY mapping when no explicit column name is given.- Specified by:
determineAnyDiscriminatorColumnName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The determined column name
-
determineAnyKeyColumnName
public Identifier determineAnyKeyColumnName(ImplicitAnyKeyColumnNameSource source)
Description copied from interface:ImplicitNamingStrategy
Determine the column name related to the key/id portion of an ANY mapping when no explicit column name is given.- Specified by:
determineAnyKeyColumnName
in interfaceImplicitNamingStrategy
- Parameters:
source
- The source information- Returns:
- The determined identifier column name
-
determineMapKeyColumnName
public Identifier determineMapKeyColumnName(ImplicitMapKeyColumnNameSource source)
- Specified by:
determineMapKeyColumnName
in interfaceImplicitNamingStrategy
-
determineListIndexColumnName
public Identifier determineListIndexColumnName(ImplicitIndexColumnNameSource source)
- Specified by:
determineListIndexColumnName
in interfaceImplicitNamingStrategy
-
determineForeignKeyName
public Identifier determineForeignKeyName(ImplicitForeignKeyNameSource source)
- Specified by:
determineForeignKeyName
in interfaceImplicitNamingStrategy
-
determineUniqueKeyName
public Identifier determineUniqueKeyName(ImplicitUniqueKeyNameSource source)
- Specified by:
determineUniqueKeyName
in interfaceImplicitNamingStrategy
-
determineIndexName
public Identifier determineIndexName(ImplicitIndexNameSource source)
- Specified by:
determineIndexName
in interfaceImplicitNamingStrategy
-
transformAttributePath
protected java.lang.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(java.lang.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
-
-