public class DBIdentifierUtilImpl extends IdentifierUtilImpl implements DBIdentifierUtil, Configurable
ANY, COLUMN, SEQUENCE, TABLE
BAR, CASE_LOWER, CASE_PRESERVE, CASE_UPPER, DOLLAR_CHAR, DOT, DOUBLE_QUOTE, EMPTY, PERCENT, SPACE, UNDERSCORE, UNDERSCORE_CHAR
Constructor and Description |
---|
DBIdentifierUtilImpl() |
DBIdentifierUtilImpl(IdentifierConfiguration config) |
Modifier and Type | Method and Description |
---|---|
DBIdentifier |
append(DBIdentifier.DBIdentifierType resultId,
DBIdentifier... names)
Appends multiple names together using the appropriate name delimiter.
|
String |
appendColumns(Column[] columns)
Appends multiple columns names together into comma delimited string.
|
String |
convertAlias(String alias)
Converts a column alias to use the appropriate delimiters
|
DBIdentifier |
convertSchemaCase(DBIdentifier name)
Convert the specified schema name to a name that the database will
be able to understand in metadata operations.
|
String |
delimit(DBIdentifier name,
boolean force) |
DBIdentifier |
fromDBName(String name,
DBIdentifier.DBIdentifierType id)
Creates a new identifier of a given type based upon the name returned
from the database.
|
JDBCConfiguration |
getConfiguration()
System configuration.
|
DBIdentifier |
getGeneratedKeySequenceName(Column col,
int maxLen)
Returns a generated key sequence identifier for the column.
|
DBIdentifier |
getValidColumnIdentifier(DBIdentifier name,
Table table,
int maxLen,
boolean checkForUniqueness)
Returns a valid column name/identifier, based upon the configuration and
provided parameters.
|
DBIdentifier |
getValidForeignKeyIdentifier(DBIdentifier name,
Table table,
Table toTable,
int maxLen)
Returns a valid foreign key identifier, based upon the configuration and
provided parameters.
|
DBIdentifier |
getValidIndexIdentifier(DBIdentifier name,
Table table,
int maxLen)
Returns a valid index identifier, based upon the configuration and
provided parameters.
|
DBIdentifier |
getValidSequenceIdentifier(DBIdentifier name,
Schema schema,
int maxLen)
Returns a valid index identifier, based upon the configuration and
provided parameters.
|
DBIdentifier |
getValidTableIdentifier(DBIdentifier name,
Schema schema,
int maxLen)
Returns a valid table identifier, based upon the configuration and provided
parameters.
|
DBIdentifier |
getValidUniqueIdentifier(DBIdentifier name,
Table table,
int maxLen)
Returns a valid unique constraint identifier, based upon the configuration and
provided parameters.
|
DBIdentifier |
makeIdentifierValid(DBIdentifier sname,
NameSet set,
int maxLen,
boolean checkForUniqueness)
Shortens the given name to the given maximum length, then checks that
it is not a reserved word.
|
DBIdentifier |
makeNameValid(String name,
NameSet set,
int maxLen,
int nameType,
boolean checkForUniqueness)
Shortens the given name to the given maximum length, then checks that
it is not a reserved word.
|
void |
setConfiguration(Configuration conf)
Invoked prior to setting bean properties.
|
String |
shorten(String name,
int targetLength) |
String |
toDBName(DBIdentifier name)
Converts the name to a name which can be used within a SQL statement.
|
String |
toDBName(DBIdentifier name,
boolean delimit)
Converts the name to a name which can be used within a SQL statement.
|
String |
toDBName(String name)
Converts the identifier to a format appropriate for the configuration.
|
String |
toDBName(String name,
boolean delimit)
Converts the identifier to a format appropriate for the configuration using
the default naming rule.
|
appendNames, appendNames, canSplit, canSplit, canSplit, canSplit, combineFull, combineNames, combineNames, combineNames, combineNames, combineNames, combineNames, combineNames, combineNames, combineNames, combineNames, convert, convertFull, delimit, delimit, delimit, delimit, delimit, delimit, endConfiguration, getIdentifierConfiguration, isDelimited, isDelimited, isDelimited, isDoubleQuoted, isReservedWord, isReservedWord, joinNames, joinNames, joinNames, joinNames, joinNames, joinNames, joinNames, needsConversion, removeDelimiters, removeDelimiters, removeDelimiters, removeDelimiters, removeDelimiters, removeHungarianNotation, removeHungarianNotation, requiresDelimiters, requiresDelimiters, requiresDelimiters, setIdentifierConfiguration, splitName, splitName, splitName, splitName, splitName, splitName, startConfiguration, truncateName, truncateName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
appendNames, appendNames, canSplit, canSplit, canSplit, canSplit, combineNames, combineNames, combineNames, combineNames, combineNames, combineNames, convert, convertFull, delimit, delimit, delimit, delimit, getIdentifierConfiguration, isDelimited, isDelimited, isReservedWord, isReservedWord, joinNames, joinNames, joinNames, joinNames, joinNames, joinNames, removeDelimiters, removeDelimiters, removeDelimiters, removeHungarianNotation, removeHungarianNotation, requiresDelimiters, requiresDelimiters, setIdentifierConfiguration, splitName, splitName, splitName, splitName, truncateName, truncateName
endConfiguration, startConfiguration
public DBIdentifierUtilImpl()
public DBIdentifierUtilImpl(IdentifierConfiguration config)
public DBIdentifier getValidColumnIdentifier(DBIdentifier name, Table table, int maxLen, boolean checkForUniqueness)
DBIdentifierUtil
getValidColumnIdentifier
in interface DBIdentifierUtil
public DBIdentifier getValidForeignKeyIdentifier(DBIdentifier name, Table table, Table toTable, int maxLen)
DBIdentifierUtil
getValidForeignKeyIdentifier
in interface DBIdentifierUtil
public DBIdentifier getValidUniqueIdentifier(DBIdentifier name, Table table, int maxLen)
DBIdentifierUtil
getValidUniqueIdentifier
in interface DBIdentifierUtil
public DBIdentifier getValidIndexIdentifier(DBIdentifier name, Table table, int maxLen)
DBIdentifierUtil
getValidIndexIdentifier
in interface DBIdentifierUtil
public DBIdentifier getValidSequenceIdentifier(DBIdentifier name, Schema schema, int maxLen)
DBIdentifierUtil
getValidSequenceIdentifier
in interface DBIdentifierUtil
public DBIdentifier getValidTableIdentifier(DBIdentifier name, Schema schema, int maxLen)
DBIdentifierUtil
getValidTableIdentifier
in interface DBIdentifierUtil
public DBIdentifier makeNameValid(String name, NameSet set, int maxLen, int nameType, boolean checkForUniqueness)
DBIdentifierUtil
makeNameValid
in interface DBIdentifierUtil
public DBIdentifier makeIdentifierValid(DBIdentifier sname, NameSet set, int maxLen, boolean checkForUniqueness)
DBIdentifierUtil
makeIdentifierValid
in interface DBIdentifierUtil
public String toDBName(DBIdentifier name)
toDBName
in interface DBIdentifierUtil
public String toDBName(DBIdentifier name, boolean delimit)
toDBName
in interface DBIdentifierUtil
delimit
- If true, allows the name to be delimited, if necessary.
Otherwise, the identifier is not delimited.public String toDBName(String name)
toDBName
in interface DBIdentifierUtil
public String toDBName(String name, boolean delimit)
toDBName
in interface DBIdentifierUtil
delimit
- If false, do not delimit. Otherwise, delimit if necessary.public DBIdentifier fromDBName(String name, DBIdentifier.DBIdentifierType id)
fromDBName
in interface DBIdentifierUtil
public DBIdentifier append(DBIdentifier.DBIdentifierType resultId, DBIdentifier... names)
DBIdentifierUtil
append
in interface DBIdentifierUtil
public String appendColumns(Column[] columns)
DBIdentifierUtil
appendColumns
in interface DBIdentifierUtil
public String delimit(DBIdentifier name, boolean force)
public DBIdentifier getGeneratedKeySequenceName(Column col, int maxLen)
DBIdentifierUtil
getGeneratedKeySequenceName
in interface DBIdentifierUtil
public DBIdentifier convertSchemaCase(DBIdentifier name)
convertSchemaCase
in interface DBIdentifierUtil
public String convertAlias(String alias)
convertAlias
in interface DBIdentifierUtil
public JDBCConfiguration getConfiguration()
public void setConfiguration(Configuration conf)
Configurable
setConfiguration
in interface Configurable
setConfiguration
in class IdentifierUtilImpl
Copyright © 2006–2019 Apache Software Foundation. All rights reserved.