|
com.im.commons.db 5.9.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DBDatabaseInfo
Provides static information about the database. This information does not need to consult the database each time for the answers and can be determined purely from static information and information that can be read from the database on startup and will never change during the lifetime of this instance. The main purpose of instances of this class is to allow client classes to get the information it requires without round trips to the database. Each database type (Oracle, MySQL...) will most likely create a different subclass.
TODO P2 - methods related to column sizing are subject to change in the future.
This functionality is split between the ColumnSizing and the ResizingSupported
enums due to the ResizingSupported enum originally being in
DBDatabaseInfo.ResizingSupported
These 2 enums should somehow be merged.
.
| Nested Class Summary | |
|---|---|
static class |
DBDatabaseInfo.ColumnSizing
Definition of sizing characteristics of column length or scale. |
static class |
DBDatabaseInfo.ColumnSQLType
Column native types. |
static class |
DBDatabaseInfo.DatabaseOperation
Types of database operations. |
static interface |
DBDatabaseInfo.NativeType
Represents a database column native type. |
static class |
DBDatabaseInfo.PKType
Supported primary key types |
static class |
DBDatabaseInfo.ResizingSupported
Enumeration of values for whether a database column can be resized. |
| Field Summary | |
|---|---|
static String |
ARRAY
|
static String |
BIGINT
|
static String |
BINARY
|
static String |
BIT
|
static String |
BLOB
|
static String |
BOOLEAN
|
static String |
CART_PROP_JChemPropertiesTable
|
static String |
CART_PROP_TableType
|
static String |
CHAR
|
static String |
CLOB
|
static String |
DATALINK
|
static String |
DATE
|
static String |
DECIMAL
|
static String |
DEFAULT_JCHEMPROPERTIES_TABLE_NAME
|
static String |
DISTINCT
|
static String |
DOUBLE
|
static String |
FLOAT
|
static String |
INDEX_UNIQUE
Constant type for the unique index. |
static String |
INT
|
static String |
INTEGER
|
static String |
JAVA_OBJECT
|
static String |
LONGVARBINARY
|
static String |
LONGVARCHAR
|
static String |
NULL
|
static String |
NUMBER
|
static String |
NUMERIC
|
static String |
NVARCHAR
|
static String |
NVARCHAR2
|
static String |
OTHER
|
static String |
REAL
|
static String |
REF
|
static String |
SMALLINT
|
static String |
STRUCT
|
static String |
TIME
|
static String |
TIMESTAMP
|
static String |
TINYINT
|
static String |
VARBINARY
|
static String |
VARCHAR
|
static String |
VARCHAR2
|
| Method Summary | |
|---|---|
DBDatabaseInfo.NativeType[] |
availableNativeTypesForColumnType(String columnType)
Get the native types that this platform supports for this particular column type. |
String |
convertAndWriteVariable(String clsName,
DBDatabaseInfo.ColumnSQLType columnType,
Object var)
Write this variable as a String so that it can be used in a DDL or DML statement. |
boolean |
convertNamesToUpperCase()
Informs whether used DB platform uses upper case for names. |
Object |
createBindVariable(String clsName,
DBDatabaseInfo.ColumnSQLType columnType,
Object var)
create a bind variable that can be used in a PreparedStatment. |
String |
fixNativeType(String nativeType)
Convert the native type to its correct form (adjust for Oracle quirks!). |
String |
getCartridgeOwner()
Get the user who owns the cartridge functions, or null if the DB does not support the JChem cartridge or the cartridge is not installed. |
String |
getDBIdentifierQuoteString()
Get the identifier needed to quote identifiers (e..g column names) for this DB. |
DBType |
getDBType()
|
String |
getDeleteRuleAction(int actionCode)
Returns a string representation of the action code for delete rule in a FK. |
String |
getJChemCartServerJChemTableVersion()
Get the index version number used by the cartridge. |
String |
getJChemCartServerJChemVersion()
Get the JChem version number used by the cartridge. |
int |
getMaxColumnNameLength()
Retrieves the maximum number of characters this database allows for a column name. |
int |
getMaxElementsInList()
|
int |
getMaxIndexNameLength()
Retrieves the maximum number of characters this database allows for a index name. |
int |
getMaxTableNameLength()
Retrieves the maximum number of characters this database allows in a table name. |
SQLElementFactory |
getSQLElementFactory()
|
SQLWriter |
getSQLWriter()
|
Set<DBDatabaseInfo.DatabaseOperation> |
getUnsupportedDatabaseOperations()
|
String |
getUpdateRuleAction(int actionCode)
Returns a string representation of the action code for update rule in a FK. |
Integer |
isCartridgeJChemTableVersionCurrent()
Compare the table version used by the cartridge to the one used by JChem. |
Integer |
isCartridgeJChemVersionCurrent()
Compare the JChem version to the JChem cartridge to the one used by the JChem version that is being used here. |
boolean |
isSupportsSchemas()
|
DBDatabaseInfo.NativeType |
nativeType(int jdbcType,
String nativeType)
Create a native type. |
DBDatabaseInfo.NativeType |
nativeType(int jdbcType,
String nativeType,
int size)
Create a native type. |
DBDatabaseInfo.NativeType |
nativeType(int jdbcType,
String nativeType,
int size,
int scale)
Create a native type. |
DBDatabaseInfo.NativeType |
nativeType(String type)
Create the NativeType for the specified column type. |
String |
prepareDefaultFromDatabaseMetadata(String value,
DBDatabaseInfo.ColumnSQLType colType)
Convert the default value read from the JDBC metadata data into the real value. |
boolean |
requiresNotNullDefault()
Determines if it is legal to declare a column NOT NULL while giving no default value. |
boolean |
requiresNotNullDefault(DBDatabaseInfo.ColumnSQLType type)
Determines if it is legal to declare a column NOT NULL while giving no default value. |
boolean |
requiresNotNullFK()
Determines, if the columns participating in FK must be NOT NULL. |
boolean |
requiresNotNullUnique()
Determines, if the DB requires a NOT NULL constraint before an UQ can be created for the field. |
String[] |
supportedForeignKeyOnDeleteValues()
|
String[] |
supportedForeignKeyOnUpdateValues()
|
String[] |
supportedIndexTypes()
|
boolean |
supportsOperation(DBDatabaseInfo.DatabaseOperation op)
Is this operation supported by the database. |
| Field Detail |
|---|
static final String DEFAULT_JCHEMPROPERTIES_TABLE_NAME
static final String CART_PROP_JChemPropertiesTable
static final String CART_PROP_TableType
static final String INDEX_UNIQUE
static final String ARRAY
static final String BIGINT
static final String BINARY
static final String BIT
static final String BLOB
static final String BOOLEAN
static final String CHAR
static final String CLOB
static final String DATALINK
static final String DATE
static final String DECIMAL
static final String DISTINCT
static final String DOUBLE
static final String FLOAT
static final String INT
static final String INTEGER
static final String JAVA_OBJECT
static final String LONGVARBINARY
static final String LONGVARCHAR
static final String NULL
static final String NUMERIC
static final String NUMBER
static final String NVARCHAR
static final String NVARCHAR2
static final String OTHER
static final String REAL
static final String REF
static final String SMALLINT
static final String STRUCT
static final String TIME
static final String TIMESTAMP
static final String TINYINT
static final String VARBINARY
static final String VARCHAR
static final String VARCHAR2
| Method Detail |
|---|
String getDBIdentifierQuoteString()
int getMaxTableNameLength()
int getMaxColumnNameLength()
int getMaxIndexNameLength()
DBType getDBType()
Set<DBDatabaseInfo.DatabaseOperation> getUnsupportedDatabaseOperations()
int getMaxElementsInList()
SQLWriter getSQLWriter()
SQLElementFactory getSQLElementFactory()
String convertAndWriteVariable(String clsName,
DBDatabaseInfo.ColumnSQLType columnType,
Object var)
Object createBindVariable(String clsName,
DBDatabaseInfo.ColumnSQLType columnType,
Object var)
boolean supportsOperation(DBDatabaseInfo.DatabaseOperation op)
DBDatabaseInfo.NativeType nativeType(String type)
DBDatabaseInfo.NativeType nativeType(int jdbcType,
String nativeType)
jdbcType - (@link java.sql.Types}nativeType - The name of native type name DBDatabaseInfo.ColumnSQLType
DBDatabaseInfo.NativeType nativeType(int jdbcType,
String nativeType,
int size)
jdbcType - (@link java.sql.Types}nativeType - The name of native type name DBDatabaseInfo.ColumnSQLTypesize - The size of the type
DBDatabaseInfo.NativeType nativeType(int jdbcType,
String nativeType,
int size,
int scale)
jdbcType - (@link java.sql.Types}nativeType - The name of native type name DBDatabaseInfo.ColumnSQLTypesize - The size of the typescale - The scale of the typeDBDatabaseInfo.NativeType[] availableNativeTypesForColumnType(String columnType)
boolean requiresNotNullDefault()
boolean requiresNotNullDefault(DBDatabaseInfo.ColumnSQLType type)
type - boolean requiresNotNullFK()
boolean requiresNotNullUnique()
String[] supportedForeignKeyOnUpdateValues()
String[] supportedForeignKeyOnDeleteValues()
String getUpdateRuleAction(int actionCode)
actionCode - The action code
String getDeleteRuleAction(int actionCode)
actionCode - The action code
String[] supportedIndexTypes()
String prepareDefaultFromDatabaseMetadata(String value,
DBDatabaseInfo.ColumnSQLType colType)
value - The default valuecolType - The column type
boolean isSupportsSchemas()
String getCartridgeOwner()
Integer isCartridgeJChemVersionCurrent()
VersionInfoInteger isCartridgeJChemTableVersionCurrent()
VersionInfoString getJChemCartServerJChemTableVersion()
VersionInfoString getJChemCartServerJChemVersion()
VersionInfoString fixNativeType(String nativeType)
nativeType -
boolean convertNamesToUpperCase()
|
com.im.commons.db 5.9.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||