类 NamingHelper
- java.lang.Object
-
- org.hibernate.boot.model.naming.NamingHelper
-
public class NamingHelper extends Object
- 作者:
- Steve Ebersole
-
-
字段概要
字段 修饰符和类型 字段 说明 static NamingHelperINSTANCESingleton access
-
构造器概要
构造器 构造器 说明 NamingHelper()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 StringgenerateHashedConstraintName(String prefix, Identifier tableName, List<Identifier> columnNames)If a constraint is not explicitly named, this is called to generate a unique hash using the table and column names.StringgenerateHashedConstraintName(String prefix, Identifier tableName, Identifier... columnNames)If a constraint is not explicitly named, this is called to generate a unique hash using the table and column names.StringgenerateHashedFkName(String prefix, Identifier tableName, Identifier referencedTableName, List<Identifier> columnNames)If a foreign-key is not explicitly named, this is called to generate a unique hash using the table and column names.StringgenerateHashedFkName(String prefix, Identifier tableName, Identifier referencedTableName, Identifier... columnNames)If a foreign-key is not explicitly named, this is called to generate a unique hash using the table and column names.StringhashedName(String s)Hash a constraint name using MD5.static NamingHelperwithCharset(String charset)
-
-
-
字段详细资料
-
INSTANCE
public static final NamingHelper INSTANCE
Singleton access
-
-
方法详细资料
-
withCharset
public static NamingHelper withCharset(String charset)
-
generateHashedFkName
public String generateHashedFkName(String prefix, Identifier tableName, Identifier referencedTableName, List<Identifier> columnNames)
If a foreign-key is not explicitly named, this is called to generate a unique hash using the table and column names.
-
generateHashedFkName
public String generateHashedFkName(String prefix, Identifier tableName, Identifier referencedTableName, Identifier... columnNames)
If a foreign-key is not explicitly named, this is called to generate a unique hash using the table and column names.
-
generateHashedConstraintName
public String generateHashedConstraintName(String prefix, Identifier tableName, Identifier... columnNames)
If a constraint is not explicitly named, this is called to generate a unique hash using the table and column names.- 返回:
- String The generated name
-
generateHashedConstraintName
public String generateHashedConstraintName(String prefix, Identifier tableName, List<Identifier> columnNames)
If a constraint is not explicitly named, this is called to generate a unique hash using the table and column names.- 返回:
- String The generated name
-
hashedName
public String hashedName(String s)
Hash a constraint name using MD5. Convert the MD5 digest to base 35 (full alphanumeric), guaranteeing that the length of the name will always be smaller than the 30 character identifier restriction enforced by a few dialects.- 参数:
s- The name to be hashed.- 返回:
- String The hashed name.
-
-