|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.cfg.DefaultNamingStrategy
public class DefaultNamingStrategy
The default NamingStrategy
a better alternative
,
Serialized FormField Summary | |
---|---|
static NamingStrategy |
INSTANCE
The singleton instance |
Constructor Summary | |
---|---|
DefaultNamingStrategy()
|
Method Summary | |
---|---|
String |
classToTableName(String className)
Return the unqualified class name |
String |
collectionTableName(String ownerEntity,
String ownerEntityTable,
String associatedEntity,
String associatedEntityTable,
String propertyName)
Return the unqualified property name, not the best strategy but a backward compatible one |
String |
columnName(String columnName)
Return the argument |
String |
foreignKeyColumnName(String propertyName,
String propertyEntityName,
String propertyTableName,
String referencedColumnName)
Return the property name or propertyTableName |
String |
joinKeyColumnName(String joinedColumn,
String joinedTable)
Return the argument |
String |
logicalCollectionColumnName(String columnName,
String propertyName,
String referencedColumn)
Return the column name if explicit or the concatenation of the property name and the referenced column |
String |
logicalCollectionTableName(String tableName,
String ownerEntityTable,
String associatedEntityTable,
String propertyName)
Returns either the table name if explicit or if there is an associated table, the concatenation of owner entity table and associated table otherwise the concatenation of owner entity table and the unqualified property name |
String |
logicalColumnName(String columnName,
String propertyName)
Return the column name or the unqualified property name |
String |
propertyToColumnName(String propertyName)
Return the unqualified property name |
String |
tableName(String tableName)
Return the argument |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final NamingStrategy INSTANCE
Constructor Detail |
---|
public DefaultNamingStrategy()
Method Detail |
---|
public String classToTableName(String className)
classToTableName
in interface NamingStrategy
className
- the fully-qualified class name
public String propertyToColumnName(String propertyName)
propertyToColumnName
in interface NamingStrategy
propertyName
- a property path
public String tableName(String tableName)
tableName
in interface NamingStrategy
tableName
- a table name
public String columnName(String columnName)
columnName
in interface NamingStrategy
columnName
- a column name
public String collectionTableName(String ownerEntity, String ownerEntityTable, String associatedEntity, String associatedEntityTable, String propertyName)
collectionTableName
in interface NamingStrategy
ownerEntityTable
- owner side table nameassociatedEntityTable
- reverse side table name if anypropertyName
- collection rolepublic String joinKeyColumnName(String joinedColumn, String joinedTable)
joinKeyColumnName
in interface NamingStrategy
joinedColumn
- joined column name (logical one) used to join withjoinedTable
- joined table name (ie the referenced table) used to join withpublic String foreignKeyColumnName(String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName)
foreignKeyColumnName
in interface NamingStrategy
propertyName
- the property name involvedpropertyTableName
- the property table name involved (logical one)referencedColumnName
- the referenced column name involved (logical one)public String logicalColumnName(String columnName, String propertyName)
logicalColumnName
in interface NamingStrategy
columnName
- given column name if anypropertyName
- property name of this columnpublic String logicalCollectionTableName(String tableName, String ownerEntityTable, String associatedEntityTable, String propertyName)
logicalCollectionTableName
in interface NamingStrategy
tableName
- the metadata explicit nameownerEntityTable
- owner table entity table name (logical one)associatedEntityTable
- reverse side table name if any (logical one)propertyName
- collection rolepublic String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn)
logicalCollectionColumnName
in interface NamingStrategy
columnName
- given column name in the metadata if anypropertyName
- property namereferencedColumn
- referenced column name (logical one) in the join
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |