站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

ImprovedNamingStrategy (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.cfg
Class ImprovedNamingStrategy

java.lang.Object
  extended bynet.sf.hibernate.cfg.ImprovedNamingStrategy
All Implemented Interfaces:
NamingStrategy

public class ImprovedNamingStrategy
extends Object
implements NamingStrategy

An improved naming strategy that prefers embedded underscores to mixed case names

Author:
Gavin King
See Also:
the default strategy

Field Summary
static NamingStrategy INSTANCE
          The singleton instance
 
Constructor Summary
protected ImprovedNamingStrategy()
           
 
Method Summary
 String classToTableName(String className)
          Return the unqualified class name, mixed case converted to underscores
 String columnName(String columnName)
          Convert mixed case to underscores
 String propertyToColumnName(String propertyName)
          Return the full property path with underscore seperators, mixed case converted to underscores
 String propertyToTableName(String className, String propertyName)
          Return the full property path prefixed by the unqualified class name, with underscore seperators, mixed case converted to underscores
 String tableName(String tableName)
          Convert mixed case to underscores
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final NamingStrategy INSTANCE
The singleton instance

Constructor Detail

ImprovedNamingStrategy

protected ImprovedNamingStrategy()
Method Detail

classToTableName

public String classToTableName(String className)
Return the unqualified class name, mixed case converted to underscores

Specified by:
classToTableName in interface NamingStrategy
Parameters:
className - the fully-qualified class name
Returns:
a table name

propertyToColumnName

public String propertyToColumnName(String propertyName)
Return the full property path with underscore seperators, mixed case converted to underscores

Specified by:
propertyToColumnName in interface NamingStrategy
Parameters:
propertyName - a property path
Returns:
a column name

tableName

public String tableName(String tableName)
Convert mixed case to underscores

Specified by:
tableName in interface NamingStrategy
Parameters:
tableName - a table name
Returns:
a table name

columnName

public String columnName(String columnName)
Convert mixed case to underscores

Specified by:
columnName in interface NamingStrategy
Parameters:
columnName - a column name
Returns:
a column name

propertyToTableName

public String propertyToTableName(String className,
                                  String propertyName)
Return the full property path prefixed by the unqualified class name, with underscore seperators, mixed case converted to underscores

Specified by:
propertyToTableName in interface NamingStrategy
Parameters:
className - the fully-qualified name of the owning entity class
propertyName - a property path
Returns:
a table name