Package org.hibernate.boot.model.naming
Class NamingHelper
java.lang.Object
org.hibernate.boot.model.naming.NamingHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateHashedConstraintName
(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.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.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
(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.hashedName
(String name) Hash a constraint name using MD5.static NamingHelper
withCharset
(String charset)
-
Field Details
-
INSTANCE
Singleton access
-
-
Constructor Details
-
NamingHelper
public NamingHelper()
-
-
Method Details
-
withCharset
-
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.- Returns:
- 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.- Returns:
- String The generated name
-
hashedName
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.- Parameters:
name
- The name to be hashed.- Returns:
- String The hashed name.
-