Class DBIdentifierUtilImpl
java.lang.Object
org.apache.openjpa.lib.identifier.IdentifierUtilImpl
org.apache.openjpa.jdbc.identifier.DBIdentifierUtilImpl
- All Implemented Interfaces:
DBIdentifierUtil,Configurable,IdentifierUtil
public class DBIdentifierUtilImpl
extends IdentifierUtilImpl
implements DBIdentifierUtil, Configurable
-
Field Summary
Fields inherited from interface org.apache.openjpa.jdbc.identifier.DBIdentifierUtil
ANY, COLUMN, SEQUENCE, TABLEFields inherited from interface org.apache.openjpa.lib.identifier.IdentifierUtil
BAR, CASE_LOWER, CASE_PRESERVE, CASE_UPPER, DOLLAR_CHAR, DOT, DOUBLE_QUOTE, EMPTY, PERCENT, SPACE, UNDERSCORE, UNDERSCORE_CHAR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(DBIdentifier.DBIdentifierType resultId, DBIdentifier... names) Appends multiple names together using the appropriate name delimiter.appendColumns(Column[] columns) Appends multiple columns names together into comma delimited string.convertAlias(String alias) Converts a column alias to use the appropriate delimitersConvert the specified schema name to a name that the database will be able to understand in metadata operations.delimit(DBIdentifier name, boolean force) fromDBName(String name, DBIdentifier.DBIdentifierType id) Creates a new identifier of a given type based upon the name returned from the database.System configuration.getGeneratedKeySequenceName(Column col, int maxLen) Returns a generated key sequence identifier for the column.getValidColumnIdentifier(DBIdentifier name, Table table, int maxLen, boolean checkForUniqueness) Returns a valid column name/identifier, based upon the configuration and provided parameters.getValidForeignKeyIdentifier(DBIdentifier name, Table table, Table toTable, int maxLen) Returns a valid foreign key identifier, based upon the configuration and provided parameters.getValidIndexIdentifier(DBIdentifier name, Table table, int maxLen) Returns a valid index identifier, based upon the configuration and provided parameters.getValidSequenceIdentifier(DBIdentifier name, Schema schema, int maxLen) Returns a valid index identifier, based upon the configuration and provided parameters.getValidTableIdentifier(DBIdentifier name, Schema schema, int maxLen) Returns a valid table identifier, based upon the configuration and provided parameters.getValidUniqueIdentifier(DBIdentifier name, Table table, int maxLen) Returns a valid unique constraint identifier, based upon the configuration and provided parameters.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.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.voidInvoked prior to setting bean properties.Converts the identifier to a format appropriate for the configuration.Converts the identifier to a format appropriate for the configuration using the default naming rule.toDBName(DBIdentifier name) Converts the name to a name which can be used within a SQL statement.toDBName(DBIdentifier name, boolean delimit) Converts the name to a name which can be used within a SQL statement.Methods inherited from class org.apache.openjpa.lib.identifier.IdentifierUtilImpl
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, truncateNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.openjpa.lib.conf.Configurable
endConfiguration, startConfigurationMethods inherited from interface org.apache.openjpa.lib.identifier.IdentifierUtil
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
-
Constructor Details
-
DBIdentifierUtilImpl
public DBIdentifierUtilImpl() -
DBIdentifierUtilImpl
-
-
Method Details
-
getValidColumnIdentifier
public DBIdentifier getValidColumnIdentifier(DBIdentifier name, Table table, int maxLen, boolean checkForUniqueness) Description copied from interface:DBIdentifierUtilReturns a valid column name/identifier, based upon the configuration and provided parameters.- Specified by:
getValidColumnIdentifierin interfaceDBIdentifierUtil
-
getValidForeignKeyIdentifier
public DBIdentifier getValidForeignKeyIdentifier(DBIdentifier name, Table table, Table toTable, int maxLen) Description copied from interface:DBIdentifierUtilReturns a valid foreign key identifier, based upon the configuration and provided parameters.- Specified by:
getValidForeignKeyIdentifierin interfaceDBIdentifierUtil
-
getValidUniqueIdentifier
Description copied from interface:DBIdentifierUtilReturns a valid unique constraint identifier, based upon the configuration and provided parameters.- Specified by:
getValidUniqueIdentifierin interfaceDBIdentifierUtil
-
getValidIndexIdentifier
Description copied from interface:DBIdentifierUtilReturns a valid index identifier, based upon the configuration and provided parameters.- Specified by:
getValidIndexIdentifierin interfaceDBIdentifierUtil
-
getValidSequenceIdentifier
Description copied from interface:DBIdentifierUtilReturns a valid index identifier, based upon the configuration and provided parameters.- Specified by:
getValidSequenceIdentifierin interfaceDBIdentifierUtil
-
getValidTableIdentifier
Description copied from interface:DBIdentifierUtilReturns a valid table identifier, based upon the configuration and provided parameters.- Specified by:
getValidTableIdentifierin interfaceDBIdentifierUtil
-
makeNameValid
public DBIdentifier makeNameValid(String name, NameSet set, int maxLen, int nameType, boolean checkForUniqueness) Description copied from interface:DBIdentifierUtilShortens 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:
makeNameValidin interfaceDBIdentifierUtil
-
makeIdentifierValid
public DBIdentifier makeIdentifierValid(DBIdentifier sname, NameSet set, int maxLen, boolean checkForUniqueness) Description copied from interface:DBIdentifierUtilShortens 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:
makeIdentifierValidin interfaceDBIdentifierUtil
-
toDBName
Converts the name to a name which can be used within a SQL statement. Uses the appropriate delimiters and separators.- Specified by:
toDBNamein interfaceDBIdentifierUtil
-
toDBName
Converts the name to a name which can be used within a SQL statement. Uses the appropriate delimiters and separators.- Specified by:
toDBNamein interfaceDBIdentifierUtil- Parameters:
delimit- If true, allows the name to be delimited, if necessary. Otherwise, the identifier is not delimited.
-
toDBName
Converts the identifier to a format appropriate for the configuration. Delimits if necessary- Specified by:
toDBNamein interfaceDBIdentifierUtil
-
toDBName
Converts the identifier to a format appropriate for the configuration using the default naming rule.- Specified by:
toDBNamein interfaceDBIdentifierUtil- Parameters:
delimit- If false, do not delimit. Otherwise, delimit if necessary.
-
fromDBName
Creates a new identifier of a given type based upon the name returned from the database.- Specified by:
fromDBNamein interfaceDBIdentifierUtil
-
append
Description copied from interface:DBIdentifierUtilAppends multiple names together using the appropriate name delimiter.- Specified by:
appendin interfaceDBIdentifierUtil
-
appendColumns
Description copied from interface:DBIdentifierUtilAppends multiple columns names together into comma delimited string.- Specified by:
appendColumnsin interfaceDBIdentifierUtil
-
delimit
-
shorten
-
getGeneratedKeySequenceName
Description copied from interface:DBIdentifierUtilReturns a generated key sequence identifier for the column.- Specified by:
getGeneratedKeySequenceNamein interfaceDBIdentifierUtil
-
convertSchemaCase
Convert the specified schema name to a name that the database will be able to understand in metadata operations.- Specified by:
convertSchemaCasein interfaceDBIdentifierUtil
-
convertAlias
Converts a column alias to use the appropriate delimiters- Specified by:
convertAliasin interfaceDBIdentifierUtil
-
getConfiguration
System configuration. -
setConfiguration
Description copied from interface:ConfigurableInvoked prior to setting bean properties.- Specified by:
setConfigurationin interfaceConfigurable- Overrides:
setConfigurationin classIdentifierUtilImpl
-