类 NamingHelper


  • public class NamingHelper
    extends Object
    作者:
    Steve Ebersole
    • 字段详细资料

      • INSTANCE

        public static final NamingHelper INSTANCE
        Singleton access
    • 构造器详细资料

      • NamingHelper

        public NamingHelper()
    • 方法详细资料

      • 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.