Top Description Methods
org.hibernate.cfg

public Interface NamingStrategy

Known Direct Implementers
org.hibernate.cfg.PersistenceStandardNamingStrategy, org.hibernate.cfg.DefaultNamingStrategy, org.hibernate.cfg.ImprovedNamingStrategy
Annotations
@Deprecated
since:6
forRemoval:true

Deprecated

for removal since 6.

org.hibernate.boot.model.naming.ImplicitNamingStrategy and org.hibernate.boot.model.naming.PhysicalNamingStrategy should be used instead.

A set of rules for determining the physical column and table names given the information in the mapping document. May be used to implement project-scoped naming standards for database objects.
Authors
Gavin King, Emmanuel Bernard
See Also
DefaultNamingStrategy, ImprovedNamingStrategy

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a table name
classToTableName
(String
the fully-qualified class name
className
)

Return a table name for an entity class

public String
collectionTableName(String ownerEntity, String
owner side table name
ownerEntityTable
,
String associatedEntity, String
reverse side table name if any
associatedEntityTable
,
String
collection role
propertyName
)

Return a collection table name ie an association having a join table

public String

Returns:

a column name
columnName
(String
a column name
columnName
)

Alter the column name given in the mapping document

public String
foreignKeyColumnName(String
the property name involved
propertyName
,
String propertyEntityName, String
the property table name involved (logical one)
propertyTableName
,
String
the referenced column name involved (logical one)
referencedColumnName
)

Return the foreign key column name for the given parameters

public String
joinKeyColumnName(String
joined column name (logical one) used to join with
joinedColumn
,
String
joined table name (ie the referenced table) used to join with
joinedTable
)

Return the join key column name ie a FK column used in a JOINED strategy or for a secondary table

public String
logicalCollectionColumnName(String
given column name in the metadata if any
columnName
,
String
property name
propertyName
,
String
referenced column name (logical one) in the join
referencedColumn
)

Returns the logical foreign key column name used to refer to this column in the mapping metadata

public String
logicalCollectionTableName(String
the metadata explicit name
tableName
,
String
owner table entity table name (logical one)
ownerEntityTable
,
String
reverse side table name if any (logical one)
associatedEntityTable
,
String
collection role
propertyName
)

Returns the logical collection table name used to refer to a table in the mapping metadata

public String
logicalColumnName(String
given column name if any
columnName
,
String
property name of this column
propertyName
)

Return the logical column name used to refer to a column in the metadata (like index, unique constraints etc) A full bijection is required between logicalNames and physical ones logicalName have to be case insensitively unique for a given table

public String

Returns:

a column name
propertyToColumnName
(String
a property path
propertyName
)

Return a column name for a property path expression

public String

Returns:

a table name
tableName
(String
a table name
tableName
)

Alter the table name given in the mapping document

Method Detail

classToTableNameback to summary
public String classToTableName(String className)

Return a table name for an entity class

Parameters
className:String

the fully-qualified class name

Returns:String

a table name

collectionTableNameback to summary
public String collectionTableName(String ownerEntity, String ownerEntityTable, String associatedEntity, String associatedEntityTable, String propertyName)

Return a collection table name ie an association having a join table

Parameters
ownerEntityTable:String

owner side table name

associatedEntityTable:String

reverse side table name if any

propertyName:String

collection role

columnNameback to summary
public String columnName(String columnName)

Alter the column name given in the mapping document

Parameters
columnName:String

a column name

Returns:String

a column name

foreignKeyColumnNameback to summary
public String foreignKeyColumnName(String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName)

Return the foreign key column name for the given parameters

Parameters
propertyName:String

the property name involved

propertyTableName:String

the property table name involved (logical one)

referencedColumnName:String

the referenced column name involved (logical one)

joinKeyColumnNameback to summary
public String joinKeyColumnName(String joinedColumn, String joinedTable)

Return the join key column name ie a FK column used in a JOINED strategy or for a secondary table

Parameters
joinedColumn:String

joined column name (logical one) used to join with

joinedTable:String

joined table name (ie the referenced table) used to join with

logicalCollectionColumnNameback to summary
public String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn)

Returns the logical foreign key column name used to refer to this column in the mapping metadata

Parameters
columnName:String

given column name in the metadata if any

propertyName:String

property name

referencedColumn:String

referenced column name (logical one) in the join

logicalCollectionTableNameback to summary
public String logicalCollectionTableName(String tableName, String ownerEntityTable, String associatedEntityTable, String propertyName)

Returns the logical collection table name used to refer to a table in the mapping metadata

Parameters
tableName:String

the metadata explicit name

ownerEntityTable:String

owner table entity table name (logical one)

associatedEntityTable:String

reverse side table name if any (logical one)

propertyName:String

collection role

logicalColumnNameback to summary
public String logicalColumnName(String columnName, String propertyName)

Return the logical column name used to refer to a column in the metadata (like index, unique constraints etc) A full bijection is required between logicalNames and physical ones logicalName have to be case insensitively unique for a given table

Parameters
columnName:String

given column name if any

propertyName:String

property name of this column

propertyToColumnNameback to summary
public String propertyToColumnName(String propertyName)

Return a column name for a property path expression

Parameters
propertyName:String

a property path

Returns:String

a column name

tableNameback to summary
public String tableName(String tableName)

Alter the table name given in the mapping document

Parameters
tableName:String

a table name

Returns:String

a table name