Top Description Fields Constructors Methods
org.hibernate.cfg

public Class EJB3NamingStrategy

extends Object
implements NamingStrategy, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.hibernate.cfg.NamingStrategy
Known Direct Subclasses
org.hibernate.cfg.DefaultComponentSafeNamingStrategy
Imports
java.io.Serializable, org.hibernate.AssertionFailure, org.hibernate.util.StringHelper

Naming strategy implementing the EJB3 standards
Author
Emmanuel Bernard

Field Summary

Modifier and TypeField and Description
public static final NamingStrategy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
classToTableName(String
the fully-qualified class name
className
)

Implements org.hibernate.cfg.NamingStrategy.classToTableName.

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
)

Implements org.hibernate.cfg.NamingStrategy.collectionTableName.

Return a collection table name ie an association having a join table
public String
columnName(String
a column name
columnName
)

Implements org.hibernate.cfg.NamingStrategy.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
)

Implements org.hibernate.cfg.NamingStrategy.foreignKeyColumnName.

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
)

Implements org.hibernate.cfg.NamingStrategy.joinKeyColumnName.

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
)

Implements org.hibernate.cfg.NamingStrategy.logicalCollectionColumnName.

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
)

Implements org.hibernate.cfg.NamingStrategy.logicalCollectionTableName.

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
)

Implements org.hibernate.cfg.NamingStrategy.logicalColumnName.

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
public String
propertyToColumnName(String
a property path
propertyName
)

Implements org.hibernate.cfg.NamingStrategy.propertyToColumnName.

Return a column name for a property path expression
public String
tableName(String
a table name
tableName
)

Implements org.hibernate.cfg.NamingStrategy.tableName.

Alter the table name given in the mapping document
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final NamingStrategy INSTANCE

Constructor Detail

EJB3NamingStrategyback to summary
public EJB3NamingStrategy()

Method Detail

classToTableNameback to summary
public String classToTableName(String className)

Implements org.hibernate.cfg.NamingStrategy.classToTableName.

Doc from org.hibernate.cfg.NamingStrategy.classToTableName.

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)

Implements org.hibernate.cfg.NamingStrategy.collectionTableName.

Doc from org.hibernate.cfg.NamingStrategy.collectionTableName.

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)

Implements org.hibernate.cfg.NamingStrategy.columnName.

Doc from org.hibernate.cfg.NamingStrategy.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)

Implements org.hibernate.cfg.NamingStrategy.foreignKeyColumnName.

Doc from org.hibernate.cfg.NamingStrategy.foreignKeyColumnName.

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)

Implements org.hibernate.cfg.NamingStrategy.joinKeyColumnName.

Doc from org.hibernate.cfg.NamingStrategy.joinKeyColumnName.

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)

Implements org.hibernate.cfg.NamingStrategy.logicalCollectionColumnName.

Doc from org.hibernate.cfg.NamingStrategy.logicalCollectionColumnName.

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)

Implements org.hibernate.cfg.NamingStrategy.logicalCollectionTableName.

Doc from org.hibernate.cfg.NamingStrategy.logicalCollectionTableName.

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)

Implements org.hibernate.cfg.NamingStrategy.logicalColumnName.

Doc from org.hibernate.cfg.NamingStrategy.logicalColumnName.

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

Parameters
columnName:String

given column name if any

propertyName:String

property name of this column

propertyToColumnNameback to summary
public String propertyToColumnName(String propertyName)

Implements org.hibernate.cfg.NamingStrategy.propertyToColumnName.

Doc from org.hibernate.cfg.NamingStrategy.propertyToColumnName.

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)

Implements org.hibernate.cfg.NamingStrategy.tableName.

Doc from org.hibernate.cfg.NamingStrategy.tableName.

Alter the table name given in the mapping document

Parameters
tableName:String

a table name

Returns:String

a table name