类 RailsNamingStrategy
java.lang.Object
org.beangle.orm.hibernate.RailsNamingStrategy
- 所有已实现的接口:
Serializable,org.hibernate.cfg.NamingStrategy
public class RailsNamingStrategy
extends Object
implements org.hibernate.cfg.NamingStrategy, Serializable
类似Rails的数据库表名、列名命名策略
- 作者:
- chaostone
- 另请参阅:
-
the default strategy- 序列化表格
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected static StringaddUnderscores(String name) classToTableName(String className) 根据实体名(entityName)命名表collectionTableName(String ownerEntity, String ownerEntityTable, String associatedEntity, String associatedEntityTable, String propertyName) Collection TablecolumnName(String columnName) 对配置文件起好的列名,不进行处理foreignKeyColumnName(String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName) Return the property name or propertyTableNamejoinKeyColumnName(String joinedColumn, String joinedTable) Return the argumentlogicalCollectionColumnName(String columnName, String propertyName, String referencedColumn) Return the column name if explicit or the concatenation of the property name and the referenced columnlogicalCollectionTableName(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 namelogicalColumnName(String columnName, String propertyName) 数据列的逻辑名propertyToColumnName(String propertyName) 根据属性名自动起名voidsetTableNamingStrategy(TableNamingStrategy tableNamingStrategy) 对自动起名和使体内集合配置的表名,添加前缀protected static String
-
构造器详细资料
-
RailsNamingStrategy
public RailsNamingStrategy()
-
-
方法详细资料
-
classToTableName
根据实体名(entityName)命名表- 指定者:
classToTableName在接口中org.hibernate.cfg.NamingStrategy- 参数:
className-
-
tableName
对自动起名和使体内集合配置的表名,添加前缀配置好的实体表名和关联表的名字都会经过此方法。
- 指定者:
tableName在接口中org.hibernate.cfg.NamingStrategy
-
columnName
对配置文件起好的列名,不进行处理- 指定者:
columnName在接口中org.hibernate.cfg.NamingStrategy
-
logicalColumnName
数据列的逻辑名如果有列名,不做处理,否则按照属性自动起名. 该策略保证columnName=logicalColumnName
- 指定者:
logicalColumnName在接口中org.hibernate.cfg.NamingStrategy
-
propertyToColumnName
根据属性名自动起名将混合大小写,带有.分割的属性描述,转换成下划线分割的名称。 属性名字包括:简单属性、集合属性、组合属性(component.name)
- 指定者:
propertyToColumnName在接口中org.hibernate.cfg.NamingStrategy- 参数:
propertyName-
-
joinKeyColumnName
Return the argument- 指定者:
joinKeyColumnName在接口中org.hibernate.cfg.NamingStrategy
-
foreignKeyColumnName
public String foreignKeyColumnName(String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName) Return the property name or propertyTableName- 指定者:
foreignKeyColumnName在接口中org.hibernate.cfg.NamingStrategy
-
collectionTableName
public String collectionTableName(String ownerEntity, String ownerEntityTable, String associatedEntity, String associatedEntityTable, String propertyName) Collection Table- 指定者:
collectionTableName在接口中org.hibernate.cfg.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在接口中org.hibernate.cfg.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在接口中org.hibernate.cfg.NamingStrategy
-
setTableNamingStrategy
-
getTableNamingStrategy
-
addUnderscores
-
unqualify
-