Top Fields Constructors Methods
org.hibernate.boot.model.naming

public Class NamingHelper

extends Object
Class Inheritance
Imports
java.io.UnsupportedEncodingException, java.math.BigInteger, java.security.MessageDigest, .NoSuchAlgorithmException, java.util.Arrays, .Comparator, .List, org.hibernate.HibernateException

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final String
public static final NamingHelper
INSTANCE

Singleton access

Constructor Summary

AccessConstructor and Description
public
private

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

String The generated name
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.

public String

Returns:

String The generated name
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.

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.

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.

public String

Returns:

String The hashed name.
hashedName
(String
The name to be hashed.
s
)

Hash a constraint name using MD5.

public static NamingHelper
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

charsetback to summary
private final String charset
INSTANCEback to summary
public static final NamingHelper INSTANCE

Singleton access

Constructor Detail

NamingHelperback to summary
public NamingHelper()
NamingHelperback to summary
private NamingHelper(String charset)

Method Detail

generateHashedConstraintNameback to summary
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

String The generated name

generateHashedConstraintNameback to summary
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

String The generated name

generateHashedFkNameback to summary
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.

generateHashedFkNameback to summary
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.

hashedNameback to summary
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.

Parameters
s:String

The name to be hashed.

Returns:String

String The hashed name.

withCharsetback to summary
public static NamingHelper withCharset(String charset)