Top Description Methods
org.hibernate.boot.model.naming

public Interface ImplicitNamingStrategy

Known Direct Implementers
org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
Annotations
@Incubating
Imports
org.hibernate.Incubating

A set of rules for determining the logical name of a mapped relational database object when the mapping for an element of the Java domain model is not explicitly specified, neither in annotations of the Java code, nor in an XML-based mapping document.

For example, if a Java class annotated @Entity has no @Table annotation, then determinePrimaryTableName is called with an ImplicitEntityNameSource providing access to information about the Java class and its entity name.

On the other hand, when a logical name is explicitly specified, for example, using @Table to specify the table name, or @Column to specify a column name, the ImplicitNamingStrategy is not called and has no opportunity to intervene in the determination of the logical name.

However, a further level of processing is applied to the resulting logical names by a PhysicalNamingStrategy in order to determine the "finally final" physical names in the relational database schema.

Whenever reasonable, the use of a custom ImplicitNamingStrategy is highly recommended in preference to tedious and repetitive explicit table and column name mappings. It's anticipated that most projects using Hibernate will feature a custom implementation of ImplicitNamingStrategy.

An ImplicitNamingStrategy may be selected using the configuration property hibernate.implicit_naming_strategy.

API Note

The method names here mostly favor the JPA terminology, for example, "secondary table" rather than "join".

Author
Steve Ebersole
See Also
PhysicalNamingStrategy, org.hibernate.cfg.Configuration#setImplicitNamingStrategy(ImplicitNamingStrategy), org.hibernate.boot.MetadataBuilder#applyImplicitNamingStrategy(ImplicitNamingStrategy), org.hibernate.cfg.AvailableSettings#IMPLICIT_NAMING_STRATEGY

Method Summary

Modifier and TypeMethod and Description
public Identifier

Returns:

The determined column name
determineAnyDiscriminatorColumnName
(ImplicitAnyDiscriminatorColumnNameSource
The source information
source
)

Determine the column name related to the discriminator portion of an org.hibernate.annotations.Any mapping when no explicit column name is given using jakarta.persistence.Column#name().

public Identifier

Returns:

The determined identifier column name
determineAnyKeyColumnName
(ImplicitAnyKeyColumnNameSource
The source information
source
)

Determine the join column name related to the key/id portion of an org.hibernate.annotations.Any mapping when no explicit join column name is given using jakarta.persistence.JoinColumn#name().

public Identifier

Returns:

The implicit column name.
determineBasicColumnName
(ImplicitBasicColumnNameSource
The source information
source
)

Determine the column name when it is not explicitly specified using jakarta.persistence.Column#name().

public Identifier

Returns:

The implicit table name.
determineCollectionTableName
(ImplicitCollectionTableNameSource
The source information
source
)

Determine the name of a collection join table given the source naming information, when a name is not explicitly given.

public Identifier

Returns:

The implicit discriminator column name
determineDiscriminatorColumnName
(ImplicitDiscriminatorColumnNameSource
The source information
source
)

Determine the discriminator column name for the given entity when it is not explicitly specified using jakarta.persistence.DiscriminatorColumn#name().

public Identifier

Returns:

The determined foreign key name
determineForeignKeyName
(ImplicitForeignKeyNameSource
The source information
source
)

Determine the foreign key name when it is not explicitly specified using jakarta.persistence.ForeignKey#name().

public Identifier

Returns:

The determined identifier column name
determineIdentifierColumnName
(ImplicitIdentifierColumnNameSource
The source information
source
)

Determine the name if the identifier column belonging to the given entity when it is not explicitly specified using jakarta.persistence.Column#name().

public Identifier

Returns:

The determined foreign key name
determineIndexName
(ImplicitIndexNameSource
The source information
source
)

Determine the index name when it is not explicitly specified using jakarta.persistence.Index#name().

public Identifier

Returns:

The determined join column name
determineJoinColumnName
(ImplicitJoinColumnNameSource
The source information
source
)

Determine the join column name when it is not explicitly specified using jakarta.persistence.JoinColumn#name().

public Identifier

Returns:

The implicit table name.
determineJoinTableName
(ImplicitJoinTableNameSource
The source information
source
)

Determine the name of an association join table given the source naming information, when a name is not explicitly given.

public Identifier

Returns:

The implicit column name.
determineListIndexColumnName
(ImplicitIndexColumnNameSource
The source information
source
)

Determine the list index column name when it is not explicitly specified using jakarta.persistence.OrderColumn#name().

public Identifier

Returns:

The implicit column name.
determineMapKeyColumnName
(ImplicitMapKeyColumnNameSource
The source information
source
)

Determine the map key column name when it is not explicitly specified using jakarta.persistence.MapKeyColumn#name().

public Identifier

Returns:

The determined column name
determinePrimaryKeyJoinColumnName
(ImplicitPrimaryKeyJoinColumnNameSource
The source information
source
)

Determine the primary key join column name when it is not explicitly specified using jakarta.persistence.PrimaryKeyJoinColumn#name().

public Identifier

Returns:

The implicit table name.
determinePrimaryTableName
(ImplicitEntityNameSource
The source information
source
)

Determine the implicit name of an entity's primary table.

public Identifier

Returns:

The determined tenant identifier column name
determineTenantIdColumnName
(ImplicitTenantIdColumnNameSource
The source information
source
)

Determine the implicit name of the tenant identifier column belonging to a given entity when it is not explicitly specified using jakarta.persistence.Column#name().

public Identifier

Returns:

The determined foreign key name
determineUniqueKeyName
(ImplicitUniqueKeyNameSource
The source information
source
)

Determine the unique key name when it is not explicitly specified using jakarta.persistence.UniqueConstraint#name().

Method Detail

determineAnyDiscriminatorColumnNameback to summary
public Identifier determineAnyDiscriminatorColumnName(ImplicitAnyDiscriminatorColumnNameSource source)

Determine the column name related to the discriminator portion of an org.hibernate.annotations.Any mapping when no explicit column name is given using jakarta.persistence.Column#name().

Parameters
source:ImplicitAnyDiscriminatorColumnNameSource

The source information

Returns:Identifier

The determined column name

determineAnyKeyColumnNameback to summary
public Identifier determineAnyKeyColumnName(ImplicitAnyKeyColumnNameSource source)

Determine the join column name related to the key/id portion of an org.hibernate.annotations.Any mapping when no explicit join column name is given using jakarta.persistence.JoinColumn#name().

Parameters
source:ImplicitAnyKeyColumnNameSource

The source information

Returns:Identifier

The determined identifier column name

determineBasicColumnNameback to summary
public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source)

Determine the column name when it is not explicitly specified using jakarta.persistence.Column#name().

Parameters
source:ImplicitBasicColumnNameSource

The source information

Returns:Identifier

The implicit column name.

determineCollectionTableNameback to summary
public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source)

Determine 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.

Parameters
source:ImplicitCollectionTableNameSource

The source information

Returns:Identifier

The implicit table name.

determineDiscriminatorColumnNameback to summary
public Identifier determineDiscriminatorColumnName(ImplicitDiscriminatorColumnNameSource source)

Determine the discriminator column name for the given entity when it is not explicitly specified using jakarta.persistence.DiscriminatorColumn#name().

Parameters
source:ImplicitDiscriminatorColumnNameSource

The source information

Returns:Identifier

The implicit discriminator column name

determineForeignKeyNameback to summary
public Identifier determineForeignKeyName(ImplicitForeignKeyNameSource source)

Determine the foreign key name when it is not explicitly specified using jakarta.persistence.ForeignKey#name().

Parameters
source:ImplicitForeignKeyNameSource

The source information

Returns:Identifier

The determined foreign key name

determineIdentifierColumnNameback to summary
public Identifier determineIdentifierColumnName(ImplicitIdentifierColumnNameSource source)

Determine the name if the identifier column belonging to the given entity when it is not explicitly specified using jakarta.persistence.Column#name().

Parameters
source:ImplicitIdentifierColumnNameSource

The source information

Returns:Identifier

The determined identifier column name

determineIndexNameback to summary
public Identifier determineIndexName(ImplicitIndexNameSource source)

Determine the index name when it is not explicitly specified using jakarta.persistence.Index#name().

Parameters
source:ImplicitIndexNameSource

The source information

Returns:Identifier

The determined foreign key name

determineJoinColumnNameback to summary
public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source)

Determine the join column name when it is not explicitly specified using jakarta.persistence.JoinColumn#name().

In hbm.xml terms, this would be a <key/> defined for a collection or the column associated with a many-to-one.

Parameters
source:ImplicitJoinColumnNameSource

The source information

Returns:Identifier

The determined join column name

determineJoinTableNameback to summary
public Identifier determineJoinTableName(ImplicitJoinTableNameSource source)

Determine 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.

Parameters
source:ImplicitJoinTableNameSource

The source information

Returns:Identifier

The implicit table name.

determineListIndexColumnNameback to summary
public Identifier determineListIndexColumnName(ImplicitIndexColumnNameSource source)

Determine the list index column name when it is not explicitly specified using jakarta.persistence.OrderColumn#name().

Parameters
source:ImplicitIndexColumnNameSource

The source information

Returns:Identifier

The implicit column name.

determineMapKeyColumnNameback to summary
public Identifier determineMapKeyColumnName(ImplicitMapKeyColumnNameSource source)

Determine the map key column name when it is not explicitly specified using jakarta.persistence.MapKeyColumn#name().

Parameters
source:ImplicitMapKeyColumnNameSource

The source information

Returns:Identifier

The implicit column name.

determinePrimaryKeyJoinColumnNameback to summary
public Identifier determinePrimaryKeyJoinColumnName(ImplicitPrimaryKeyJoinColumnNameSource source)

Determine the primary key join column name when it is not explicitly specified using jakarta.persistence.PrimaryKeyJoinColumn#name().

In hbm.xml terms, this would be a <key/> defined for a <join/> or a <joined-subclass/>.

Parameters
source:ImplicitPrimaryKeyJoinColumnNameSource

The source information

Returns:Identifier

The determined column name

determinePrimaryTableNameback to summary
public Identifier determinePrimaryTableName(ImplicitEntityNameSource source)

Determine the implicit name of an entity's primary table.

Parameters
source:ImplicitEntityNameSource

The source information

Returns:Identifier

The implicit table name.

determineTenantIdColumnNameback to summary
public Identifier determineTenantIdColumnName(ImplicitTenantIdColumnNameSource source)

Determine the implicit name of the tenant identifier column belonging to a given entity when it is not explicitly specified using jakarta.persistence.Column#name().

Parameters
source:ImplicitTenantIdColumnNameSource

The source information

Returns:Identifier

The determined tenant identifier column name

determineUniqueKeyNameback to summary
public Identifier determineUniqueKeyName(ImplicitUniqueKeyNameSource source)

Determine the unique key name when it is not explicitly specified using jakarta.persistence.UniqueConstraint#name().

Parameters
source:ImplicitUniqueKeyNameSource

The source information

Returns:Identifier

The determined foreign key name