Package org.jumpmind.db.platform
Class DatabaseInfo
java.lang.Object
org.jumpmind.db.platform.DatabaseInfo
Contains information about the database platform such as supported features and native type mappings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNativeTypeMapping
(int jdbcTypeCode, String nativeType) Adds a mapping from jdbc type to database-native type.void
addNativeTypeMapping
(int jdbcTypeCode, String nativeType, int targetJdbcTypeCode) Adds a mapping from jdbc type to database-native type.void
addNativeTypeMapping
(String jdbcTypeName, String nativeType) Adds a mapping from jdbc type to database-native type.void
addNativeTypeMapping
(String jdbcTypeName, String nativeType, String targetJdbcTypeName) Adds a mapping from jdbc type to database-native type.boolean
boolean
Returns the string that denotes the beginning of a comment.Returns the string that denotes the end of a comment.getDefaultSize
(int jdbcTypeCode) Returns the default size value for the given type, if any.Returns the text that is used to delimit identifiers (eg.boolean
Determines whether the platform is able to read the auto-increment status for columns from an existing database.int
Returns the maximum number of characters that a column name can have.int
Returns the maximum number of characters that a constraint name can have.int
Returns the maximum number of characters that a foreign key name can have.int
getMaxSize
(String nativeType) int
Returns the maximum number of characters that a table name can have.int
getNativeType
(int typeCode) Returns the database-native type for the given type code.Returns the text separating individual sql commands.int
getTargetJdbcType
(int typeCode) Returns the jdbc type corresponding to the native type that is used for the given jdbc type.Returns the text that is used for for quoting values (e.g.boolean
hasNullDefault
(int sqlTypeCode) Determines whether the native type for the given sql type code (one of theTypes
constants) has a null default value on this platform.boolean
hasPrecisionAndScale
(int sqlTypeCode) Determines whether the native type for the given sql type code (one of theTypes
constants) has precision and scale specifications on this platform.boolean
hasSize
(int sqlTypeCode) Determines whether the native type for the given sql type code (one of theTypes
constants) has a size specification on this platform.boolean
Determines whether an ALTER TABLE statement shall be used for dropping indices or constraints.boolean
Determines whether auto-commit mode for the reading of the values of identity columns after insertion shall be used, i.e.boolean
boolean
boolean
boolean
boolean
Determines whether default values can be specified for LONGVARCHAR/LONGVARBINARY columns.boolean
Determines whether the auto-increment specification uses the DEFAULT value of the column definition.boolean
Determines whether delimited identifiers are supported.boolean
Returns whether embedded foreign key constraints should have a name.boolean
boolean
Determines whether expressions can be used as default values.boolean
Determines whether foreign key constraints are embedded in the create table clause or as seperate alter table statements.boolean
Determines whether indices are supported.boolean
boolean
Determines whether generated/computed/virtual columns are supported.boolean
Determines whether the platform is allows the explicit specification of values for identity columns in INSERT/UPDATE statements.boolean
Determines whether the indices are embedded in the create table clause or as seperate statements.boolean
Determines whether indices are supported.boolean
boolean
boolean
Determines whether the values of identity columns can be read back from the database after insertion of a row.boolean
boolean
boolean
Determines whether non-primary key columns can be auto-incrementing (IDENTITY columns).boolean
boolean
Determines whether a NULL needs to be explicitly stated when the column has no specified default value.boolean
Determines whether primary key constraints are embedded in the create table clause or as seperate alter table statements.boolean
boolean
boolean
boolean
Determines whether the database supports SQL comments.boolean
Determines whether the platform returns synthetic default values (e.g.boolean
Determines whether system indices for foreign keys are always non-unique or can be unique (i.e.boolean
Determines whether database-generated indices for primary and foreign keys are returned when reading a model from a database.boolean
Determines whether table-level logging is supported.boolean
boolean
boolean
boolean
Determines whether unique constraints are embedded in the column definition or as separate constraint statements.boolean
void
setAlterTableForDropUsed
(boolean useAlterTableForDrop) Specifies whether an ALTER TABLE statement shall be used for dropping indices or constraints.void
setAutoCommitModeForLastIdentityValueReading
(boolean autoCommitModeForLastIdentityValueReading) Determines whether auto-commit mode for the reading of the values of identity columns after insertion shall be used, i.e.void
setAutoIncrementUpdateAllowed
(boolean autoIncrementUpdateAllowed) void
setBinaryQuoteEnd
(String binaryQuoteEnd) void
setBinaryQuoteStart
(String binaryQuoteStart) void
setBlankCharColumnSpacePadded
(boolean blankCharColumnSpacePadded) void
setCanDeleteUsingExists
(boolean canDeleteUsingExists) void
setCanTriggerExistWithoutTable
(boolean canTriggerExistWithoutTable) void
setCatalogSeparator
(String catalogSeparator) void
setCharColumnSpaceTrimmed
(boolean charColumnSpaceTrimmed) void
setCommentPrefix
(String commentPrefix) Sets the text that starts a comment.void
setCommentSuffix
(String commentSuffix) Sets the text that ends a comment.void
setCteExpression
(String cteExpression) void
setDateOverridesToTimestamp
(boolean dateOverridesToTimestamp) void
setDefaultSize
(int jdbcTypeCode, int defaultSize) Adds a default size for the given jdbc type.void
setDefaultSize
(String jdbcTypeName, int defaultSize) Adds a default size for the given jdbc type.void
setDefaultValuesForLongTypesSupported
(boolean isSupported) Specifies whether default values can be specified for LONGVARCHAR/LONGVARBINARY columns.void
setDefaultValuesToLeaveUnquotedSupplier
(Supplier<Set<String>> defaultValuesToLeaveUnquotedSupplier) void
setDefaultValuesToTranslateSupplier
(Supplier<Map<String, String>> defaultValuesToTranslateSupplier) void
setDefaultValueUsedForIdentitySpec
(boolean identitySpecUsesDefaultValue) Specifies whether the auto-increment specification uses the DEFAULT value of the column definition.void
setDelimitedIdentifiersSupported
(boolean areSupported) Specifies whether delimited identifiers are supported.void
setDelimiterToken
(String delimiterToken) Sets the text that is used to delimit identifiers (eg.void
setEmbeddedForeignKeysNamed
(boolean embeddedForeignKeysNamed) Specifies whether embedded foreign key constraints should be named.void
setEmptyStringNulled
(boolean emptyStringNulled) void
setExpressionsAsDefaultValuesSupported
(boolean expressionsAsDefaultValuesSupported) Specifies whether expressions can be used as default values.void
setForeignKeysEmbedded
(boolean foreignKeysEmbedded) Specifies whether foreign key constraints are embedded in the create table clause or as seperate alter table statements.void
setForeignKeysSupported
(boolean foreignKeysSupported) Specifies whether indices are supported.void
setFunctionalIndicesSupported
(boolean functionalIndicesSupported) void
setGeneratedColumnsSupported
(boolean generatedColumnsSupported) Specifies whether generated/computed/virtual columns are supported.void
setHasNullDefault
(int sqlTypeCode, boolean hasNullDefault) Specifies whether the native type for the given sql type code (one of theTypes
constants) has a null default value on this platform.void
setHasPrecisionAndScale
(int sqlTypeCode, boolean hasPrecisionAndScale) Specifies whether the native type for the given sql type code (one of theTypes
constants) has precision and scale specifications on this platform.void
setHasSize
(int sqlTypeCode, boolean hasSize) Specifies whether the native type for the given sql type code (one of theTypes
constants) has a size specification on this platform.void
setIdentityOverrideAllowed
(boolean identityOverrideAllowed) Specifies whether the platform is allows the explicit specification of values for identity columns in INSERT/UPDATE statements.void
setIdentityStatusReadingSupported
(boolean canReadAutoIncrementStatus) Specifies whether the platform is able to read the auto-increment status for columns from an existing database.void
setIndicesEmbedded
(boolean indicesEmbedded) Specifies whether indices are embedded in the create table clause or as seperate alter table statements.void
setIndicesSupported
(boolean supportingIndices) Specifies whether indices are supported.void
setInfinityDateAllowed
(boolean infinityDateAllowed) void
setJdbcTimestampAllowed
(boolean jdbcTimestampAllowed) void
setLastIdentityValueReadable
(boolean lastIdentityValueReadable) Specifies whether the values of identity columns can be read back from the database after insertion of a row.void
setLogBased
(boolean logBased) void
setMaxColumnNameLength
(int maxColumnNameLength) Sets the maximum length of column names that this database allows.void
setMaxConstraintNameLength
(int maxConstraintNameLength) Sets the maximum length of constraint names that this database allows.void
setMaxForeignKeyNameLength
(int maxForeignKeyNameLength) Sets the maximum length of foreign key names that this database allows.void
setMaxIdentifierLength
(int maxIdentifierLength) Sets the maximum length of all identifiers that this database allows.void
setMaxSize
(String nativeType, int defaultSize) void
setMaxTableNameLength
(int maxTableNameLength) Sets the maximum length of table names that this database allows.void
setMinIsolationLevelToPreventPhantomReads
(int minIsolationLevelToPreventPhantomReads) void
setNonBlankCharColumnSpacePadded
(boolean nonBlankCharColumnSpacePadded) void
setNonPKIdentityColumnsSupported
(boolean supportingNonPKIdentityColumns) Specifies whether non-primary key columns can be auto-incrementing (IDENTITY columns).void
setNotNullColumnsSupported
(boolean notNullColumnsSupported) void
setNullAsDefaultValueRequired
(boolean requiresNullAsDefaultValue) Specifies whether a NULL needs to be explicitly stated when the column has no specified default value.void
setPrimaryKeyEmbedded
(boolean primaryKeyEmbedded) Specifies whether the primary key constraints are embedded in the create table clause or as seperate alter table statements.void
setRequiredCharColumnEmptyStringSameAsNull
(boolean requiredCharColumnEmptyStringSameAsNull) void
setRequiresAutoCommitForDdl
(boolean requireAutoCommitForDdl) void
setRequiresSavePointsInTransaction
(boolean requiresSavePointsInTransaction) void
setSchemaSeparator
(String schemaSeparator) void
setSqlCommandDelimiter
(String sqlCommandDelimiter) Sets the text separating individual sql commands.void
setSqlCommentsSupported
(boolean commentsSupported) Specifies whether SQL comments are supported by the database.void
setSyntheticDefaultValueForRequiredReturned
(boolean returningDefaultValue) Specifies whether the platform returns synthetic default values (e.g.void
setSystemForeignKeyIndicesAlwaysNonUnique
(boolean alwaysNonUnique) Specifies whether system indices for foreign keys are always non-unique or can be unique (i.e.void
setSystemIndicesReturned
(boolean returningSystemIndices) Specifies whether database-generated indices for primary and foreign keys are returned when reading a model from a database.void
setTableLevelLoggingSupported
(boolean value) Specifies whether table-level logging is supported.void
setTriggersContainJava
(boolean triggersContainJava) void
setTriggersCreateOrReplaceSupported
(boolean triggersCreateOrReplaceSupported) void
setTriggersSupported
(boolean triggersSupported) void
setUniqueEmbedded
(boolean unique) Specifies whether the unique constraints are embedded in the column definition or as separate constraint statements.void
setValueQuoteToken
(String valueQuoteChar) Sets the text that is used for for quoting values (e.g.void
setZeroDateAllowed
(boolean zeroDateAllowed)
-
Constructor Details
-
DatabaseInfo
public DatabaseInfo()Creates a new platform info object.
-
-
Method Details
-
isNullAsDefaultValueRequired
public boolean isNullAsDefaultValueRequired()Determines whether a NULL needs to be explicitly stated when the column has no specified default value. Default is false.- Returns:
true
if NULL must be written for empty default values
-
setNullAsDefaultValueRequired
public void setNullAsDefaultValueRequired(boolean requiresNullAsDefaultValue) Specifies whether a NULL needs to be explicitly stated when the column has no specified default value. Default is false.- Parameters:
requiresNullAsDefaultValue
- Whether NULL must be written for empty default values
-
isDefaultValuesForLongTypesSupported
public boolean isDefaultValuesForLongTypesSupported()Determines whether default values can be specified for LONGVARCHAR/LONGVARBINARY columns.- Returns:
true
if default values are allowed
-
setDefaultValuesForLongTypesSupported
public void setDefaultValuesForLongTypesSupported(boolean isSupported) Specifies whether default values can be specified for LONGVARCHAR/LONGVARBINARY columns.- Parameters:
isSupported
-true
if default values are supported
-
isPrimaryKeyEmbedded
public boolean isPrimaryKeyEmbedded()Determines whether primary key constraints are embedded in the create table clause or as seperate alter table statements. The default is embedded pks.- Returns:
true
if pk constraints are embedded
-
setPrimaryKeyEmbedded
public void setPrimaryKeyEmbedded(boolean primaryKeyEmbedded) Specifies whether the primary key constraints are embedded in the create table clause or as seperate alter table statements.- Parameters:
primaryKeyEmbedded
- Whether pk constraints are embedded
-
isForeignKeysEmbedded
public boolean isForeignKeysEmbedded()Determines whether foreign key constraints are embedded in the create table clause or as seperate alter table statements. Per default, foreign keys are external.- Returns:
true
if fk constraints are embedded
-
setForeignKeysEmbedded
public void setForeignKeysEmbedded(boolean foreignKeysEmbedded) Specifies whether foreign key constraints are embedded in the create table clause or as seperate alter table statements.- Parameters:
foreignKeysEmbedded
- Whether fk constraints are embedded
-
isEmbeddedForeignKeysNamed
public boolean isEmbeddedForeignKeysNamed()Returns whether embedded foreign key constraints should have a name.- Returns:
true
if embedded fks have name
-
setEmbeddedForeignKeysNamed
public void setEmbeddedForeignKeysNamed(boolean embeddedForeignKeysNamed) Specifies whether embedded foreign key constraints should be named.- Parameters:
embeddedForeignKeysNamed
- Whether embedded fks shall have a name
-
isIndicesSupported
public boolean isIndicesSupported()Determines whether indices are supported.- Returns:
true
if indices are supported
-
setIndicesSupported
public void setIndicesSupported(boolean supportingIndices) Specifies whether indices are supported.- Parameters:
supportingIndices
-true
if indices are supported
-
isTableLevelLoggingSupported
public boolean isTableLevelLoggingSupported()Determines whether table-level logging is supported. -
setTableLevelLoggingSupported
public void setTableLevelLoggingSupported(boolean value) Specifies whether table-level logging is supported. -
isForeignKeysSupported
public boolean isForeignKeysSupported()Determines whether indices are supported.- Returns:
true
if indices are supported
-
setForeignKeysSupported
public void setForeignKeysSupported(boolean foreignKeysSupported) Specifies whether indices are supported.- Parameters:
supportingIndices
-true
if indices are supported
-
isIndicesEmbedded
public boolean isIndicesEmbedded()Determines whether the indices are embedded in the create table clause or as seperate statements. Per default, indices are external.- Returns:
true
if indices are embedded
-
setIndicesEmbedded
public void setIndicesEmbedded(boolean indicesEmbedded) Specifies whether indices are embedded in the create table clause or as seperate alter table statements.- Parameters:
indicesEmbedded
- Whether indices are embedded
-
isUniqueEmbedded
public boolean isUniqueEmbedded()Determines whether unique constraints are embedded in the column definition or as separate constraint statements. The default is non-embedded unique.- Returns:
true
if unique constraints are embedded
-
setUniqueEmbedded
public void setUniqueEmbedded(boolean unique) Specifies whether the unique constraints are embedded in the column definition or as separate constraint statements.- Parameters:
primaryKeyEmbedded
- Whether unique constraints are embedded
-
isNonPKIdentityColumnsSupported
public boolean isNonPKIdentityColumnsSupported()Determines whether non-primary key columns can be auto-incrementing (IDENTITY columns).- Returns:
true
if normal non-PK columns can be auto-incrementing
-
setNonPKIdentityColumnsSupported
public void setNonPKIdentityColumnsSupported(boolean supportingNonPKIdentityColumns) Specifies whether non-primary key columns can be auto-incrementing (IDENTITY columns).- Parameters:
supportingNonPKIdentityColumns
-true
if normal non-PK columns can be auto-incrementing
-
isGeneratedColumnsSupported
public boolean isGeneratedColumnsSupported()Determines whether generated/computed/virtual columns are supported.- Returns:
true
if generated/computed/virtual columns are supported
-
setGeneratedColumnsSupported
public void setGeneratedColumnsSupported(boolean generatedColumnsSupported) Specifies whether generated/computed/virtual columns are supported.- Parameters:
generatedColumnsSupported
-true
if generated/computed/virtual columns are supported
-
isExpressionsAsDefaultValuesSupported
public boolean isExpressionsAsDefaultValuesSupported()Determines whether expressions can be used as default values.- Returns:
true
if expressions can be used as default values
-
setExpressionsAsDefaultValuesSupported
public void setExpressionsAsDefaultValuesSupported(boolean expressionsAsDefaultValuesSupported) Specifies whether expressions can be used as default values.- Parameters:
expressionsAsDefaultValuesSupported
-true
if expressions can be used as default values
-
isDefaultValueUsedForIdentitySpec
public boolean isDefaultValueUsedForIdentitySpec()Determines whether the auto-increment specification uses the DEFAULT value of the column definition.- Returns:
true
if the auto-increment spec is done via the DEFAULT value
-
setDefaultValueUsedForIdentitySpec
public void setDefaultValueUsedForIdentitySpec(boolean identitySpecUsesDefaultValue) Specifies whether the auto-increment specification uses the DEFAULT value of the column definition.- Parameters:
identitySpecUsesDefaultValue
-true
if the auto-increment spec is done via the DEFAULT value
-
isSystemIndicesReturned
public boolean isSystemIndicesReturned()Determines whether database-generated indices for primary and foreign keys are returned when reading a model from a database.- Returns:
true
if system indices are read from a live database
-
setSystemIndicesReturned
public void setSystemIndicesReturned(boolean returningSystemIndices) Specifies whether database-generated indices for primary and foreign keys are returned when reading a model from a database.- Parameters:
returningSystemIndices
-true
if system indices are read from a live database
-
isSystemForeignKeyIndicesAlwaysNonUnique
public boolean isSystemForeignKeyIndicesAlwaysNonUnique()Determines whether system indices for foreign keys are always non-unique or can be unique (i.e. if a primary key column is used to establish the foreign key).- Returns:
true
if system foreign key indices are always non-unique; default isfalse
-
setSystemForeignKeyIndicesAlwaysNonUnique
public void setSystemForeignKeyIndicesAlwaysNonUnique(boolean alwaysNonUnique) Specifies whether system indices for foreign keys are always non-unique or can be unique (i.e. if a primary key column is used to establish the foreign key).- Parameters:
alwaysNonUnique
-true
if system foreign key indices are always non-unique
-
isSyntheticDefaultValueForRequiredReturned
public boolean isSyntheticDefaultValueForRequiredReturned()Determines whether the platform returns synthetic default values (e.g. 0 for numeric columns etc.) for non-identity required columns when reading a model from a database.- Returns:
true
if synthetic default values are returned for non-identity required columns
-
setSyntheticDefaultValueForRequiredReturned
public void setSyntheticDefaultValueForRequiredReturned(boolean returningDefaultValue) Specifies whether the platform returns synthetic default values (e.g. 0 for numeric columns etc.) for non-identity required columns when reading a model from a database.- Parameters:
returningDefaultValue
-true
if synthetic default values are returned for non-identity required columns
-
getIdentityStatusReadingSupported
public boolean getIdentityStatusReadingSupported()Determines whether the platform is able to read the auto-increment status for columns from an existing database.- Returns:
true
if the auto-increment status can be determined from an existing database
-
setIdentityStatusReadingSupported
public void setIdentityStatusReadingSupported(boolean canReadAutoIncrementStatus) Specifies whether the platform is able to read the auto-increment status for columns from an existing database.- Parameters:
canReadAutoIncrementStatus
-true
if the auto-increment status can be determined from an existing database
-
isSqlCommentsSupported
public boolean isSqlCommentsSupported()Determines whether the database supports SQL comments.- Returns:
true
if comments are supported
-
setSqlCommentsSupported
public void setSqlCommentsSupported(boolean commentsSupported) Specifies whether SQL comments are supported by the database.- Parameters:
commentsSupported
-true
if comments are supported
-
isDelimitedIdentifiersSupported
public boolean isDelimitedIdentifiersSupported()Determines whether delimited identifiers are supported.- Returns:
true
if delimited identifiers are supported
-
setDelimitedIdentifiersSupported
public void setDelimitedIdentifiersSupported(boolean areSupported) Specifies whether delimited identifiers are supported.- Parameters:
areSupported
-true
if delimited identifiers are supported
-
isAlterTableForDropUsed
public boolean isAlterTableForDropUsed()Determines whether an ALTER TABLE statement shall be used for dropping indices or constraints. The default is false.- Returns:
true
if ALTER TABLE is required
-
setAlterTableForDropUsed
public void setAlterTableForDropUsed(boolean useAlterTableForDrop) Specifies whether an ALTER TABLE statement shall be used for dropping indices or constraints.- Parameters:
useAlterTableForDrop
- Whether ALTER TABLE will be used
-
isIdentityOverrideAllowed
public boolean isIdentityOverrideAllowed()Determines whether the platform is allows the explicit specification of values for identity columns in INSERT/UPDATE statements.- Returns:
true
if values for identity columns can be specified
-
setIdentityOverrideAllowed
public void setIdentityOverrideAllowed(boolean identityOverrideAllowed) Specifies whether the platform is allows the explicit specification of values for identity columns in INSERT/UPDATE statements.- Parameters:
identityOverrideAllowed
-true
if values for identity columns can be specified
-
isLastIdentityValueReadable
public boolean isLastIdentityValueReadable()Determines whether the values of identity columns can be read back from the database after insertion of a row.- Returns:
true
if the identity column(s) can be read back
-
setLastIdentityValueReadable
public void setLastIdentityValueReadable(boolean lastIdentityValueReadable) Specifies whether the values of identity columns can be read back from the database after insertion of a row.- Parameters:
lastIdentityValueReadable
-true
if the identity column(s) can be read back
-
isAutoCommitModeForLastIdentityValueReading
public boolean isAutoCommitModeForLastIdentityValueReading()Determines whether auto-commit mode for the reading of the values of identity columns after insertion shall be used, i.e. whether between the insertion of the row and the reading of the database-generated identity value a commit is issued.- Returns:
true
if auto-commit mode is used
-
setAutoCommitModeForLastIdentityValueReading
public void setAutoCommitModeForLastIdentityValueReading(boolean autoCommitModeForLastIdentityValueReading) Determines whether auto-commit mode for the reading of the values of identity columns after insertion shall be used, i.e. whether between the insertion of the row and the reading of the database-generated identity value a commit is issued.- Parameters:
autoCommitModeForLastIdentityValueReading
-true
if auto-commit mode shall be used
-
getMaxTableNameLength
public int getMaxTableNameLength()Returns the maximum number of characters that a table name can have.- Returns:
- The number of characters, or -1 if not limited
-
getMaxColumnNameLength
public int getMaxColumnNameLength()Returns the maximum number of characters that a column name can have.- Returns:
- The number of characters, or -1 if not limited
-
getMaxConstraintNameLength
public int getMaxConstraintNameLength()Returns the maximum number of characters that a constraint name can have.- Returns:
- The number of characters, or -1 if not limited
-
getMaxForeignKeyNameLength
public int getMaxForeignKeyNameLength()Returns the maximum number of characters that a foreign key name can have.- Returns:
- The number of characters, or -1 if not limited
-
setMaxIdentifierLength
public void setMaxIdentifierLength(int maxIdentifierLength) Sets the maximum length of all identifiers that this database allows. Use this method if the length limit is the same for all kinds of identifiers.- Parameters:
maxIdentifierLength
- The maximum identifier length, -1 if unlimited
-
setMaxTableNameLength
public void setMaxTableNameLength(int maxTableNameLength) Sets the maximum length of table names that this database allows.- Parameters:
maxTableNameLength
- The maximum length, -1 if unlimited
-
setMaxColumnNameLength
public void setMaxColumnNameLength(int maxColumnNameLength) Sets the maximum length of column names that this database allows.- Parameters:
maxColumnNameLength
- The maximum length, -1 if unlimited
-
setMaxConstraintNameLength
public void setMaxConstraintNameLength(int maxConstraintNameLength) Sets the maximum length of constraint names that this database allows.- Parameters:
maxConstraintNameLength
- The maximum length, -1 if unlimited
-
setMaxForeignKeyNameLength
public void setMaxForeignKeyNameLength(int maxForeignKeyNameLength) Sets the maximum length of foreign key names that this database allows.- Parameters:
maxForeignKeyNameLength
- The maximum length, -1 if unlimited
-
getDelimiterToken
Returns the text that is used to delimit identifiers (eg. table names). Per default, this is a double quotation character (").- Returns:
- The delimiter text
-
setDelimiterToken
Sets the text that is used to delimit identifiers (eg. table names).- Parameters:
delimiterToken
- The delimiter text
-
getValueQuoteToken
Returns the text that is used for for quoting values (e.g. text) when printing default values and in generates insert/update/delete statements. Per default, this is a single quotation character (').- Returns:
- The quote text
-
setValueQuoteToken
Sets the text that is used for for quoting values (e.g. text) when printing default values and in generates insert/update/delete statements.- Parameters:
valueQuoteChar
- The new quote text
-
getCommentPrefix
Returns the string that denotes the beginning of a comment.- Returns:
- The comment prefix
-
setCommentPrefix
Sets the text that starts a comment.- Parameters:
commentPrefix
- The new comment prefix
-
getCommentSuffix
Returns the string that denotes the end of a comment. Note that comments will be always on their own line.- Returns:
- The comment suffix
-
setCommentSuffix
Sets the text that ends a comment.- Parameters:
commentSuffix
- The new comment suffix
-
getSqlCommandDelimiter
Returns the text separating individual sql commands.- Returns:
- The delimiter text
-
setSqlCommandDelimiter
Sets the text separating individual sql commands.- Parameters:
sqlCommandDelimiter
- The delimiter text
-
getNativeType
Returns the database-native type for the given type code.- Parameters:
typeCode
- TheTypes
type code- Returns:
- The native type or
null
if there isn't one defined
-
getTargetJdbcType
public int getTargetJdbcType(int typeCode) Returns the jdbc type corresponding to the native type that is used for the given jdbc type. This is most often the same jdbc type, but can also be a different one. For instance, if a database has no native boolean type, then the source jdbc type would beBIT
orBOOLEAN
, and the target jdbc type might beTINYINT
orSMALLINT
.- Parameters:
typeCode
- TheTypes
type code- Returns:
- The target jdbc type
-
addNativeTypeMapping
Adds a mapping from jdbc type to database-native type.- Parameters:
jdbcTypeCode
- The jdbc type code as defined byTypes
nativeType
- The native type
-
addNativeTypeMapping
Adds a mapping from jdbc type to database-native type.- Parameters:
jdbcTypeCode
- The jdbc type code as defined byTypes
nativeType
- The native typetargetJdbcTypeCode
- The jdbc type code corresponding to the native type (e.g. when reading the model from the database)
-
addNativeTypeMapping
Adds a mapping from jdbc type to database-native type. Note that this method accesses the named constant inTypes
via reflection and is thus safe to use under JDK 1.2/1.3 even with constants defined only in later Java versions - for these, the method simply will not add a mapping.- Parameters:
jdbcTypeName
- The jdbc type name, one of the constants defined inTypes
nativeType
- The native type
-
addNativeTypeMapping
Adds a mapping from jdbc type to database-native type. Note that this method accesses the named constant inTypes
via reflection and is thus safe to use under JDK 1.2/1.3 even with constants defined only in later Java versions - for these, the method simply will not add a mapping.- Parameters:
jdbcTypeName
- The jdbc type name, one of the constants defined inTypes
nativeType
- The native typetargetJdbcTypeName
- The jdbc type corresponding to the native type (e.g. when reading the model from the database)
-
hasNullDefault
public boolean hasNullDefault(int sqlTypeCode) Determines whether the native type for the given sql type code (one of theTypes
constants) has a null default value on this platform.- Parameters:
sqlTypeCode
- The sql type code- Returns:
true
if the native type has a null default value
-
setHasNullDefault
public void setHasNullDefault(int sqlTypeCode, boolean hasNullDefault) Specifies whether the native type for the given sql type code (one of theTypes
constants) has a null default value on this platform.- Parameters:
sqlTypeCode
- The sql type codehasNullDefault
-true
if the native type has a null default value
-
hasSize
public boolean hasSize(int sqlTypeCode) Determines whether the native type for the given sql type code (one of theTypes
constants) has a size specification on this platform.- Parameters:
sqlTypeCode
- The sql type code- Returns:
true
if the native type has a size specification
-
setHasSize
public void setHasSize(int sqlTypeCode, boolean hasSize) Specifies whether the native type for the given sql type code (one of theTypes
constants) has a size specification on this platform.- Parameters:
sqlTypeCode
- The sql type codehasSize
-true
if the native type has a size specification
-
getDefaultSize
Returns the default size value for the given type, if any.- Parameters:
jdbcTypeCode
- The jdbc type code- Returns:
- The default size or
null
if none is defined
-
setDefaultSize
public void setDefaultSize(int jdbcTypeCode, int defaultSize) Adds a default size for the given jdbc type.- Parameters:
jdbcTypeCode
- The jdbc type codedefaultSize
- The default size
-
setDefaultSize
Adds a default size for the given jdbc type.- Parameters:
jdbcTypeName
- The name of the jdbc type, one of theTypes
constantsdefaultSize
- The default size
-
getMaxSize
-
setMaxSize
-
hasPrecisionAndScale
public boolean hasPrecisionAndScale(int sqlTypeCode) Determines whether the native type for the given sql type code (one of theTypes
constants) has precision and scale specifications on this platform.- Parameters:
sqlTypeCode
- The sql type code- Returns:
true
if the native type has precision and scale specifications
-
setHasPrecisionAndScale
public void setHasPrecisionAndScale(int sqlTypeCode, boolean hasPrecisionAndScale) Specifies whether the native type for the given sql type code (one of theTypes
constants) has precision and scale specifications on this platform.- Parameters:
sqlTypeCode
- The sql type codehasPrecisionAndScale
-true
if the native type has precision and scale specifications
-
getDefaultValuesToLeaveUnquoted
-
setDefaultValuesToLeaveUnquotedSupplier
-
getDefaultValuesToTranslate
-
setDefaultValuesToTranslateSupplier
-
setTriggersSupported
public void setTriggersSupported(boolean triggersSupported) -
isTriggersSupported
public boolean isTriggersSupported() -
isDateOverridesToTimestamp
public boolean isDateOverridesToTimestamp() -
setDateOverridesToTimestamp
public void setDateOverridesToTimestamp(boolean dateOverridesToTimestamp) -
isEmptyStringNulled
public boolean isEmptyStringNulled() -
setEmptyStringNulled
public void setEmptyStringNulled(boolean emptyStringNulled) -
setBlankCharColumnSpacePadded
public void setBlankCharColumnSpacePadded(boolean blankCharColumnSpacePadded) -
isBlankCharColumnSpacePadded
public boolean isBlankCharColumnSpacePadded() -
setCharColumnSpaceTrimmed
public void setCharColumnSpaceTrimmed(boolean charColumnSpaceTrimmed) -
isCharColumnSpaceTrimmed
public boolean isCharColumnSpaceTrimmed() -
setNonBlankCharColumnSpacePadded
public void setNonBlankCharColumnSpacePadded(boolean nonBlankCharColumnSpacePadded) -
isNonBlankCharColumnSpacePadded
public boolean isNonBlankCharColumnSpacePadded() -
isAutoIncrementUpdateAllowed
public boolean isAutoIncrementUpdateAllowed() -
setAutoIncrementUpdateAllowed
public void setAutoIncrementUpdateAllowed(boolean autoIncrementUpdateAllowed) -
setRequiresAutoCommitForDdl
public void setRequiresAutoCommitForDdl(boolean requireAutoCommitForDdl) -
isRequiresAutoCommitForDdl
public boolean isRequiresAutoCommitForDdl() -
setRequiresSavePointsInTransaction
public void setRequiresSavePointsInTransaction(boolean requiresSavePointsInTransaction) -
isRequiresSavePointsInTransaction
public boolean isRequiresSavePointsInTransaction() -
getMinIsolationLevelToPreventPhantomReads
public int getMinIsolationLevelToPreventPhantomReads() -
setMinIsolationLevelToPreventPhantomReads
public void setMinIsolationLevelToPreventPhantomReads(int minIsolationLevelToPreventPhantomReads) -
isRequiredCharColumnEmptyStringSameAsNull
public boolean isRequiredCharColumnEmptyStringSameAsNull() -
setRequiredCharColumnEmptyStringSameAsNull
public void setRequiredCharColumnEmptyStringSameAsNull(boolean requiredCharColumnEmptyStringSameAsNull) -
getBinaryQuoteStart
-
setBinaryQuoteStart
-
getBinaryQuoteEnd
-
setBinaryQuoteEnd
-
setCatalogSeparator
-
getCatalogSeparator
-
setSchemaSeparator
-
getSchemaSeparator
-
isNotNullColumnsSupported
public boolean isNotNullColumnsSupported() -
setNotNullColumnsSupported
public void setNotNullColumnsSupported(boolean notNullColumnsSupported) -
isZeroDateAllowed
public boolean isZeroDateAllowed() -
setZeroDateAllowed
public void setZeroDateAllowed(boolean zeroDateAllowed) -
isInfinityDateAllowed
public boolean isInfinityDateAllowed() -
setInfinityDateAllowed
public void setInfinityDateAllowed(boolean infinityDateAllowed) -
isTriggersCreateOrReplaceSupported
public boolean isTriggersCreateOrReplaceSupported() -
setTriggersCreateOrReplaceSupported
public void setTriggersCreateOrReplaceSupported(boolean triggersCreateOrReplaceSupported) -
getCteExpression
-
setCteExpression
-
isLogBased
public boolean isLogBased() -
setLogBased
public void setLogBased(boolean logBased) -
isTriggersContainJava
public boolean isTriggersContainJava() -
setTriggersContainJava
public void setTriggersContainJava(boolean triggersContainJava) -
isFunctionalIndicesSupported
public boolean isFunctionalIndicesSupported() -
setFunctionalIndicesSupported
public void setFunctionalIndicesSupported(boolean functionalIndicesSupported) -
canDeleteUsingExists
public boolean canDeleteUsingExists() -
setCanDeleteUsingExists
public void setCanDeleteUsingExists(boolean canDeleteUsingExists) -
canTriggerExistWithoutTable
public boolean canTriggerExistWithoutTable() -
setCanTriggerExistWithoutTable
public void setCanTriggerExistWithoutTable(boolean canTriggerExistWithoutTable) -
isJdbcTimestampAllowed
public boolean isJdbcTimestampAllowed() -
setJdbcTimestampAllowed
public void setJdbcTimestampAllowed(boolean jdbcTimestampAllowed)
-