FileDocCategorySizeDatePackage
NamingStrategy.javaAPI DocHibernate 3.2.53907Thu May 04 10:10:22 BST 2006org.hibernate.cfg

NamingStrategy

public interface NamingStrategy
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. #propertyToTableName(String, String) should be replaced by {@link #collectionTableName(String,String,String,String,String)}
see
DefaultNamingStrategy
see
ImprovedNamingStrategy
author
Gavin King
author
Emmanuel Bernard

Fields Summary
Constructors Summary
Methods Summary
public java.lang.StringclassToTableName(java.lang.String className)
Return a table name for an entity class

param
className the fully-qualified class name
return
a table name

public java.lang.StringcollectionTableName(java.lang.String ownerEntity, java.lang.String ownerEntityTable, java.lang.String associatedEntity, java.lang.String associatedEntityTable, java.lang.String propertyName)
Return a collection table name ie an association having a join table

param
ownerEntity
param
ownerEntityTable owner side table name
param
associatedEntity
param
associatedEntityTable reverse side table name if any
param
propertyName collection role

public java.lang.StringcolumnName(java.lang.String columnName)
Alter the column name given in the mapping document

param
columnName a column name
return
a column name

public java.lang.StringforeignKeyColumnName(java.lang.String propertyName, java.lang.String propertyEntityName, java.lang.String propertyTableName, java.lang.String referencedColumnName)
Return the foreign key column name for the given parameters

param
propertyName the property name involved
param
propertyEntityName
param
propertyTableName the property table name involved (logical one)
param
referencedColumnName the referenced column name involved (logical one)

public java.lang.StringjoinKeyColumnName(java.lang.String joinedColumn, java.lang.String joinedTable)
Return the join key column name ie a FK column used in a JOINED strategy or for a secondary table

param
joinedColumn joined column name (logical one) used to join with
param
joinedTable joined table name (ie the referenced table) used to join with

public java.lang.StringlogicalCollectionColumnName(java.lang.String columnName, java.lang.String propertyName, java.lang.String referencedColumn)
Returns the logical foreign key column name used to refer to this column in the mapping metadata

param
columnName given column name in the metadata if any
param
propertyName property name
param
referencedColumn referenced column name (logical one) in the join

public java.lang.StringlogicalCollectionTableName(java.lang.String tableName, java.lang.String ownerEntityTable, java.lang.String associatedEntityTable, java.lang.String propertyName)
Returns the logical collection table name used to refer to a table in the mapping metadata

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

public java.lang.StringlogicalColumnName(java.lang.String columnName, java.lang.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 insersitively unique for a given table

param
columnName given column name if any
param
propertyName property name of this column

public java.lang.StringpropertyToColumnName(java.lang.String propertyName)
Return a column name for a property path expression

param
propertyName a property path
return
a column name

public java.lang.StringtableName(java.lang.String tableName)
Alter the table name given in the mapping document

param
tableName a table name
return
a table name