Class DBIdentifierUtilImpl

    • Constructor Detail

      • DBIdentifierUtilImpl

        public DBIdentifierUtilImpl()
    • Method Detail

      • makeNameValid

        public DBIdentifier makeNameValid​(java.lang.String name,
                                          NameSet set,
                                          int maxLen,
                                          int nameType,
                                          boolean checkForUniqueness)
        Description copied from interface: DBIdentifierUtil
        Shortens the given name to the given maximum length, then checks that it is not a reserved word. If it is reserved, appends a "0". If the name conflicts with an existing schema component and uniqueness checking is enabled, the last character is replace with '0', then '1', etc. Note that the given max len may be 0 if the database metadata is incomplete. Note: If the name is delimited, make sure the ending delimiter is not stripped off.
        Specified by:
        makeNameValid in interface DBIdentifierUtil
      • makeIdentifierValid

        public DBIdentifier makeIdentifierValid​(DBIdentifier sname,
                                                NameSet set,
                                                int maxLen,
                                                boolean checkForUniqueness)
        Description copied from interface: DBIdentifierUtil
        Shortens the given name to the given maximum length, then checks that it is not a reserved word. If it is reserved, appends a "0". If the name conflicts with an existing schema component and uniqueness checking is enabled, the last character is replace with '0', then '1', etc. Note that the given max len may be 0 if the database metadata is incomplete. Note: If the name is delimited, make sure the ending delimiter is not stripped off.
        Specified by:
        makeIdentifierValid in interface DBIdentifierUtil
      • toDBName

        public java.lang.String toDBName​(DBIdentifier name)
        Converts the name to a name which can be used within a SQL statement. Uses the appropriate delimiters and separators.
        Specified by:
        toDBName in interface DBIdentifierUtil
      • toDBName

        public java.lang.String toDBName​(DBIdentifier name,
                                         boolean delimit)
        Converts the name to a name which can be used within a SQL statement. Uses the appropriate delimiters and separators.
        Specified by:
        toDBName in interface DBIdentifierUtil
        Parameters:
        delimit - If true, allows the name to be delimited, if necessary. Otherwise, the identifier is not delimited.
      • toDBName

        public java.lang.String toDBName​(java.lang.String name)
        Converts the identifier to a format appropriate for the configuration. Delimits if necessary
        Specified by:
        toDBName in interface DBIdentifierUtil
      • toDBName

        public java.lang.String toDBName​(java.lang.String name,
                                         boolean delimit)
        Converts the identifier to a format appropriate for the configuration using the default naming rule.
        Specified by:
        toDBName in interface DBIdentifierUtil
        Parameters:
        delimit - If false, do not delimit. Otherwise, delimit if necessary.
      • appendColumns

        public java.lang.String appendColumns​(Column[] columns)
        Description copied from interface: DBIdentifierUtil
        Appends multiple columns names together into comma delimited string.
        Specified by:
        appendColumns in interface DBIdentifierUtil
      • delimit

        public java.lang.String delimit​(DBIdentifier name,
                                        boolean force)
      • shorten

        public java.lang.String shorten​(java.lang.String name,
                                        int targetLength)
      • convertAlias

        public java.lang.String convertAlias​(java.lang.String alias)
        Converts a column alias to use the appropriate delimiters
        Specified by:
        convertAlias in interface DBIdentifierUtil
      • getConfiguration

        public JDBCConfiguration getConfiguration()
        System configuration.