org.hibernate.cfg
Class ImprovedNamingStrategy
java.lang.Object
org.hibernate.cfg.ImprovedNamingStrategy
- NamingStrategy, Serializable
public class ImprovedNamingStrategy
extends java.lang.Object
An improved naming strategy that prefers embedded
underscores to mixed case names
protected static String | addUnderscores(String name)
|
String | classToTableName(String className) - Return the unqualified class name, mixed case converted to
underscores
|
String | collectionTableName(String ownerEntity, String ownerEntityTable, String associatedEntity, String associatedEntityTable, String propertyName)
|
String | columnName(String columnName) - Convert mixed case to underscores
|
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 full property path with underscore seperators, mixed
case converted to underscores
|
String | tableName(String tableName) - Convert mixed case to underscores
|
INSTANCE
public static final NamingStrategy INSTANCE
A convenient singleton instance
addUnderscores
protected static String addUnderscores(String name)
classToTableName
public String classToTableName(String className)
Return the unqualified class name, mixed case converted to
underscores
- classToTableName in interface NamingStrategy
collectionTableName
public String collectionTableName(String ownerEntity,
String ownerEntityTable,
String associatedEntity,
String associatedEntityTable,
String propertyName)
- collectionTableName in interface NamingStrategy
columnName
public String columnName(String columnName)
Convert mixed case to underscores
- columnName in interface NamingStrategy
foreignKeyColumnName
public String foreignKeyColumnName(String propertyName,
String propertyEntityName,
String propertyTableName,
String referencedColumnName)
Return the property name or propertyTableName
- foreignKeyColumnName in interface NamingStrategy
joinKeyColumnName
public String joinKeyColumnName(String joinedColumn,
String joinedTable)
Return the argument
- joinKeyColumnName in interface NamingStrategy
logicalCollectionColumnName
public 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
- logicalCollectionColumnName in interface NamingStrategy
logicalCollectionTableName
public 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
- logicalCollectionTableName in interface NamingStrategy
logicalColumnName
public String logicalColumnName(String columnName,
String propertyName)
Return the column name or the unqualified property name
- logicalColumnName in interface NamingStrategy
propertyToColumnName
public String propertyToColumnName(String propertyName)
Return the full property path with underscore seperators, mixed
case converted to underscores
- propertyToColumnName in interface NamingStrategy
tableName
public String tableName(String tableName)
Convert mixed case to underscores
- tableName in interface NamingStrategy