|
SolarMetric Kodo JDO 3.0.3 generated on February 20 2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kodo.jdbc.sql.DBDictionary
Class which allows the creation of SQL dynamically, in a database agnostic fashion. Subclass for the nuances of different data stores.
Field Summary | |
protected static int |
CENTI
|
protected static int |
DECI
|
protected static int |
MICRO
|
protected static int |
MILLI
|
protected static int |
NANO
|
static String |
SCHEMA_CASE_DEFAULT
Symbolic constant for setSchemaCase that indicates that
no changes should be made to the specified schema name. |
static String |
SCHEMA_CASE_LOWER
Symbolic constant for setSchemaCase that indicates that
schema names should always be converted to lower-case. |
static String |
SCHEMA_CASE_PRESERVE
Symbolic constant for setSchemaCase that indicates that
no changes should be made to the specified schema name. |
static String |
SCHEMA_CASE_UPPER
Symbolic constant for setSchemaCase that indicates that
schema names should always be converted to upper-case. |
protected static int |
SEC
|
Constructor Summary | |
DBDictionary()
|
Method Summary | |
void |
addSystemSchema(String schemaName)
Add the name of a schema that should not be reflected on. |
void |
addSystemTable(String tableName)
Add the name of a table that should not be reflected on. |
protected String |
appendSize(Column col,
String typeName)
Helper method to append the size and decimal digits to the given type name. |
boolean |
canBatch(Column col)
Returns type if the specified column can be included in batch statements. |
boolean |
canLock(Select select)
Returns true if a "FOR UPDATE" clause can be used for the specified Select object. |
void |
configureReflectedColumn(Column col,
String typeName)
Configure the specified column with the typeName from the DatabaseMetaData . |
protected String |
convertSchemaCase(String objectName)
Convert the specified schema name to a name that the database will be able to understand. |
Connection |
decorate(Connection conn)
Decorate the given connection if needed. |
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object. |
String[] |
getAddColumnSQL(Column column)
Return a series of SQL statements to add the given column to its table. |
String[] |
getAddForeignKeySQL(ForeignKey fk)
Return a series of SQL statements to add the given foreign key to its table. |
String[] |
getAddPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to add the given primary key to its table. |
Array |
getArray(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
InputStream |
getAsciiStream(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getAutoIncrementClause()
|
String |
getAutoIncrementTypeName()
|
int |
getBatchLimit()
The maximum number of statements per SQL batch. |
int |
getBatchParameterLimit()
The maximum number of parameters that can be batched. |
BigDecimal |
getBigDecimal(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
BigInteger |
getBigInteger(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getBigintTypeName()
The schema definition name for Types.BIGINT . |
InputStream |
getBinaryStream(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getBinaryTypeName()
The schema definition name for Types.BINARY . |
String |
getBitTypeName()
The schema definition name for Types.BIT . |
Blob |
getBlob(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Object |
getBlobObject(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
InputStream |
getBlobStream(ResultSet rs,
int column)
Returns an InputStream for the blob data specified
in the ResultSet . |
String |
getBlobTypeName()
The schema definition name for Types.BLOB . |
boolean |
getBoolean(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
byte |
getByte(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
byte[] |
getBytes(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
protected String |
getCatalogNameForMetadata(String catalogName)
Returns the catalog name that will be used for obtaining information from DatabaseMetaData . |
String |
getCatalogSeparator()
Returns the separator String between the schema name and the table name. |
char |
getChar(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Reader |
getCharacterStream(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getCharTypeName()
The schema definition name for Types.CHAR . |
Clob |
getClob(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getClobString(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getClobTypeName()
The schema definition name for Types.CLOB . |
protected String |
getColumnNameForMetadata(String columnName)
Returns the column name that will be used for obtaining information from DatabaseMetaData . |
ColumnInfo[] |
getColumns(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
String columnName,
Connection conn)
Return a result set in the form expected by DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) . |
JDBCConfiguration |
getConfiguration()
Get the configuration for this dictionary. |
protected boolean |
getConstraintNameBeforeDeclaration()
Return whether the name of the constraint should come before or after the constraint declaration. |
String[] |
getCreateIndexSQL(Index index)
Return a series of SQL statements to create the given index. |
boolean |
getCreatePrimaryKeys()
If false, then do not specify that identifiers are primary keys. |
String[] |
getCreateTableSQL(Table table)
Return a series of SQL statements to create the given table, complete with columns. |
Date |
getDate(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
Date |
getDate(ResultSet rs,
int column,
Calendar cal)
Convert the specified column of the SQL ResultSet to the proper java type. |
protected int |
getDatePrecision()
Set to the precision of timestamps in the data store. |
String |
getDateTypeName()
The schema definition name for Types.DATE . |
DBMetaData |
getDBMetaData()
Return the DBMetaData for this dictionary. |
String |
getDecimalTypeName()
The schema definition name for Types.DECIMAL . |
protected String |
getDeclareColumnSQL(Column col,
boolean alter)
Return the declaration SQL for the given column. |
String |
getDistinctTypeName()
The schema definition name for Types.DISTINCT . |
double |
getDouble(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getDoubleTypeName()
The schema definition name for Types.DOUBLE . |
String[] |
getDropColumnSQL(Column column)
Return a series of SQL statements to drop the given column from its table. |
String[] |
getDropForeignKeySQL(ForeignKey fk)
Return a series of SQL statements to drop the given foreign key from its table. |
String[] |
getDropIndexSQL(Index index)
Return a series of SQL statements to drop the given index. |
String[] |
getDropPrimaryKeySQL(PrimaryKey pk)
Return a series of SQL statements to drop the given primary key from its table. |
String[] |
getDropTableSQL(Table table)
Return a series of SQL statements to drop the given table. |
float |
getFloat(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getFloatTypeName()
The schema definition name for Types.FLOAT . |
protected String |
getForeignKeyActionName(int action)
Return the action SQL for the given foreign key. |
protected String |
getForeignKeyConstraintSQL(ForeignKey fk)
Return the declaration SQL for the given foreign key, or null if it is not supported. |
String |
getForUpdateClause()
The clause that is used for issuing "SELECT ... |
protected SQLBuffer |
getFrom(Select sel)
Return the portion of the select statement between the FROM keyword and the WHERE keyword. |
String |
getFullName(Index index)
Returns the full name of the index, including the schema (delimited by the result of getCatalogSeparator() ). |
String |
getFullName(Table table)
Returns the full name of the table, including the schema (delimited by the result of getCatalogSeparator() ). |
long |
getGeneratedKey(Column col,
Connection conn)
Return the last inserted auto increment value for the given column. |
ForeignKeyInfo[] |
getImportedKeys(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
Connection conn)
Return a result set in the form expected by DatabaseMetaData.getImportedKeys(java.lang.String, java.lang.String, java.lang.String) , though only the
PKTABLE_SCHEM, PKTABLE_NAME, PKCOLUMN_NAME, FKTABLE_SCHEM,
FKTABLE_NAME, FKCOLUMN_NAME, KEY_SEQ, DELETE_RULE, FK_NAME,
DEFERRABILITY columns are required. |
IndexInfo[] |
getIndexInfo(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
boolean unique,
boolean approx,
Connection conn)
Return a result set in the form expected by DatabaseMetaData.getIndexInfo(java.lang.String, java.lang.String, java.lang.String, boolean, boolean) , though only the
TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, INDEX_NAME,
COLUMN_NAME columns are required. |
String |
getInitializationSQL()
SQL that will be issued to the database whenever a connection is made. |
int |
getInt(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getIntegerTypeName()
The schema definition name for Types.INTEGER . |
String |
getJavaObjectTypeName()
The schema definition name for Types.JAVA_OBJECT . |
int |
getJDBCType(int metaTypeCode,
boolean lob)
Return the preferred Types constant for the given
FieldMapping constant. |
String |
getJoinSyntax()
The join syntax to use as a string for automatic configuration: sql92, traditional, database |
int |
getJoinSyntaxConstant()
The SQL join syntax to use as one of the Join syntax constants. |
String |
getLastGeneratedKeyQuery()
The query that will be used to query the last automatically generated key on the server. |
String |
getLastGeneratedKeyQuery(Column column)
|
Locale |
getLocale(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
long |
getLong(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getLongVarbinaryTypeName()
The schema definition name for Types.LONGVARBINARY . |
String |
getLongVarcharTypeName()
The schema definition name for Types.LONGVARCHAR . |
int |
getMaxCharacterFieldLength()
Returns the maximum number of characters a VARCHAR type field can hold. |
int |
getMaxColumnNameLength()
Returns the maximum number of characters in a column name for this database. |
int |
getMaxForeignKeyNameLength()
Returns the maximum number of characters in a foreign key name for this database. |
int |
getMaxIndexesPerTable()
The maximum number of indexes that can be created for a single table, or Integer.MAX_VALUE if there is no limit. |
int |
getMaxIndexNameLength()
Returns the maximum number of characters in a foreign key name for this database. |
Integer |
getMaxKeyNameLength()
The maximum number of characters in any key. |
int |
getMaxPrimaryKeyNameLength()
Returns the maximum number of characters in a primary key name for this database. |
int |
getMaxTableNameLength()
Returns the maximum number of characters in a table name for this database. |
String |
getNullTypeName()
The schema definition name for Types.NULL . |
String |
getNumericTypeName()
The schema definition name for Types.NUMERIC . |
Object |
getObject(ResultSet rs,
int column,
Map map)
Convert the specified column of the SQL ResultSet to the proper java type. |
protected SQLBuffer |
getOrderings(Select sel,
SQLBuffer selectSQL)
Return the portion of the select statement after the ORDER BY clause, or null if no orderings. |
String |
getOtherTypeName()
The schema definition name for Types.OTHER . |
String |
getPlatform()
The database platform for this dictionary. |
int |
getPreferredType(int type)
Return the preferred Types type for the given one. |
protected String |
getPrimaryKeyConstraintSQL(PrimaryKey pk)
Return the declaration SQL for the given primary key. |
PrimaryKeyInfo[] |
getPrimaryKeys(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
Connection conn)
Return an array of PrimaryKeyInfo for the specified
schema objects. |
protected PrimaryKeyInfo[] |
getPrimaryKeysFromBestRowIdentifier(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
Connection conn)
|
protected PrimaryKeyInfo[] |
getPrimaryKeysFromGetPrimaryKeys(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
Connection conn)
|
String |
getRealTypeName()
The schema definition name for Types.REAL . |
Ref |
getRef(ResultSet rs,
int column,
Map map)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getRefTypeName()
The schema definition name for Types.REF . |
Collection |
getReservedKeywords()
Returns an upper-case list of keywords that this database considers "reserved". |
String |
getReservedWords()
A comma-separated list of additional reserved words for this database. |
String |
getSchemaCase()
Return how schema names (schema name, tables, database names) should be manipulated. |
protected String |
getSchemaNameForMetadata(String schemaName)
Returns the schema name that will be used for obtaining information from DatabaseMetaData . |
protected SQLBuffer |
getSelects(Select sel)
Return the portion of the select statement between the SELECT keyword and the FROM keyword. |
short |
getShort(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
boolean |
getSimulateLocking()
If true, pessimistic locking will be allowed even if the database does not support locking. |
protected String |
getSizeClause(Column col)
|
String |
getSmallintTypeName()
The schema definition name for Types.SMALLINT . |
boolean |
getStorageLimitationsFatal()
Whether or not an exception should be thrown if value alteration needs to take place in order to be able to be stored in the database. |
boolean |
getStoreCharsAsNumbers()
If true, Java char values will be stored as numbers. |
boolean |
getStoreLargeNumbersAsStrings()
If true, BigDecimal s and BigInteger s will be stored as
strings. |
String |
getString(ResultSet rs,
int column)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getStructTypeName()
The schema definition name for Types.STRUCT . |
boolean |
getSupportsDeferredConstraints()
|
boolean |
getSupportsForeignKeys()
Whether this database supports foreign keys or not. |
boolean |
getSupportsLockingWithDistinctClause()
Whether this database supports "FOR UPDATE" queries with a "DISTINCT" clause. |
boolean |
getSupportsLockingWithInnerJoin()
Whether this database supports "FOR UPDATE" queries with inner joins. |
boolean |
getSupportsLockingWithMultipleTables()
Whether this database supports "FOR UPDATE" queries with multiple tables. |
boolean |
getSupportsLockingWithOrderClause()
Whether this database supports "FOR UPDATE" queries with "ORDER BY" clauses. |
boolean |
getSupportsLockingWithOuterJoin()
Whether this database supports "FOR UPDATE" queries with outer joins. |
boolean |
getSupportsMultipleNontransactionalResultSets()
Whether this dictionary supports multiple result sets outside of a transaction. |
boolean |
getSupportsNullTableForGetColumns()
If true, calls to ResultSet#getColumns can handle
a null table. |
boolean |
getSupportsNullTableForGetImportedKeys()
If true, calls to ResultSet#getImportedKeys can handle
a null table. |
boolean |
getSupportsNullTableForGetIndexInfo()
If true, calls to ResultSet#getIndexInfo can handle
a null table. |
boolean |
getSupportsNullTableForGetPrimaryKeys()
If true, calls to ResultSet#getPrimaryKeys can handle
a null table. |
boolean |
getSupportsSchemaForGetColumns()
Some drivers have problems with using the schema name in calls to DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) . |
boolean |
getSupportsSchemaForGetTables()
Some drivers have problems with using the schema name in calls to DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) . |
Boolean |
getSupportsSelectForUpdate()
Whether this dictionary supports "SELECT ... |
Collection |
getSystemSchemas()
Return the list of system schemas that will not be reflected on when constructing the in-memory representation of the schema. |
Collection |
getSystemTables()
Return the list of system tables that will not be reflected on when constructing the in-memory representation of the schema. |
String |
getTableForUpdateClause()
The per-table clause to append to each table alias in a SELECT. |
protected String |
getTableNameForMetadata(String tableName)
Returns the table name that will be used for obtaining information from DatabaseMetaData . |
TableInfo[] |
getTables(DatabaseMetaData meta,
String catalog,
String schemaName,
String tableName,
Connection conn)
Return a result set in the form expected by DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) . |
String |
getTableTypes()
The table types to look for when reflecting on the schema, separated by commas. |
Time |
getTime(ResultSet rs,
int column,
Calendar cal)
Convert the specified column of the SQL ResultSet to the proper java type. |
Timestamp |
getTimestamp(ResultSet rs,
int column,
Calendar cal)
Convert the specified column of the SQL ResultSet to the proper java type. |
String |
getTimestampTypeName()
The schema definition name for Types.TIMESTAMP . |
String |
getTimeTypeName()
The schema definition name for Types.TIME . |
String |
getTinyintTypeName()
The schema definition name for Types.TINYINT . |
protected String |
getTypeName(Column col)
Return the preferred database type for the given column's type from Types . |
boolean |
getUseGetBestRowIdentifierForPrimaryKeys()
|
boolean |
getUseGetBytesForBlobs()
If true, use ResultSet.getBytes(int) for blobs. |
boolean |
getUseGetObjectForBlobs()
If true, use ResultSet.getObject(int) to obtain blob data. |
boolean |
getUseSchemaName()
Whether to use the schema name when constructing a full table name. |
boolean |
getUseSetBytesForBlobs()
If true, use PreparedStatement.setBytes(int, byte[]) for blobs. |
boolean |
getUseStringsForClobs()
|
String |
getValidationSQL()
Simple SQL used to validate connections. |
String |
getValidColumnName(String name,
Table table)
Make any necessary changes to the given column name to make it valid for the current DB. |
String |
getValidForeignKeyName(String name,
Table table,
Table toTable)
Make any necessary changes to the given foreign key name to make it valid for the current DB. |
String |
getValidIndexName(String name,
Table table)
Make any necessary changes to the given index name to make it valid for the current DB. |
String |
getValidPrimaryKeyName(String name,
Table table)
Make any necessary changes to the given primary key name to make it valid for the current DB. |
String |
getValidTableName(String name,
Schema schema)
Make any necessary changes to the given table name to make it valid for the current DB. |
String |
getVarbinaryTypeName()
The schema definition name for Types.VARBINARY . |
String |
getVarcharTypeName()
The schema definition name for Types.VARCHAR . |
protected SQLBuffer |
getWhere(Select sel)
Return the portion of the select statement between the WHERE keyword and the ORDER BY clause, or null if no where conditions. |
boolean |
isReserved(String name)
Returns true if this database considers a name as "reserved". |
boolean |
isSupported()
By default, all dictionaries are supported except for the generic DBDictionary. |
boolean |
isSystemIndex(String name,
Table table)
This method is used to filter system indexes from database metadata. |
boolean |
isSystemTable(String name,
String schema,
boolean targetSchema)
This method is used to filter system tables from database metadata. |
String |
makeNameValid(String name,
NameSet set,
int maxLen)
Shortens the given name to the given maximum length, then checks that it is not a reserved word. |
int |
maxKeyNameLength()
Returns the maximum number of characters in a generic key name (e.g., an index, a primary or foreign key) for this database. |
protected ColumnInfo |
newColumnInfo(ResultSet rs)
Construct a new ColumnInfo from the given ResultSet |
protected ForeignKeyInfo |
newForeignKeyInfo(ResultSet rs)
Construct a new ForeignKeyInfo from the given ResultSet |
protected IndexInfo |
newIndexInfo(ResultSet rs)
Construct a new IndexInfo from the given ResultSet |
protected PrimaryKeyInfo |
newPrimaryKeyInfo(ResultSet rs)
Construct a new PrimaryKeyInfo from the given ResultSet |
protected TableInfo |
newTableInfo(ResultSet rs)
Construct a new TableInfo from the given ResultSet |
void |
refSchemaComponents(Table table)
Increment the reference count of any table components that this dictionary adds that are not used by mappings. |
ClassMapping |
replaceMapping(ClassMapping mapping)
Replace the given mapping with one suited to this database, or return the original if no replacement is needed. |
FieldMapping |
replaceMapping(FieldMapping mapping)
Replace the given mapping with one suited to this database, or return the original if no replacement is needed. |
MappingFactory |
replaceMappingFactory(MappingFactory factory)
Replace the given factory with one suited to this database, or return the original if no replacement is needed. |
SchemaFactory |
replaceSchemaFactory(SchemaFactory factory)
Replace the given factory with one suited to this database, or return the original if no replacement is needed. |
protected String |
replaceSize(Column col,
String typeName)
Helper method to change the size parameters of the specified type. |
byte[] |
serialize(Object val)
Return the serialized bytes for the given object. |
void |
setArray(PreparedStatement stmnt,
int idx,
Array val)
Set the given value as a parameter to the statement. |
void |
setAsciiStream(PreparedStatement stmnt,
int idx,
InputStream val,
int length)
Set the given value as a parameter to the statement. |
void |
setAutoIncrementClause(String autoIncrementClause)
|
void |
setAutoIncrementTypeName(String autoIncrementTypeName)
|
void |
setBatchLimit(int batch)
The maximum number of statements per SQL batch. |
void |
setBatchParameterLimit(int batchParameterLimit)
The maximum number of parameters that can be batched. |
void |
setBigDecimal(PreparedStatement stmnt,
int idx,
BigDecimal val)
Set the given value as a parameter to the statement. |
void |
setBigInteger(PreparedStatement stmnt,
int idx,
BigInteger val)
Set the given value as a parameter to the statement. |
void |
setBigintTypeName(String bigintTypeName)
The schema definition name for Types.BIGINT . |
void |
setBinaryStream(PreparedStatement stmnt,
int idx,
InputStream val,
int length)
Set the given value as a parameter to the statement. |
void |
setBinaryTypeName(String binaryTypeName)
The schema definition name for Types.BINARY . |
void |
setBitTypeName(String bitTypeName)
The schema definition name for Types.BIT . |
void |
setBlob(PreparedStatement stmnt,
int idx,
Blob val)
Set the given value as a parameter to the statement. |
void |
setBlobObject(PreparedStatement stmnt,
int idx,
Object val)
Set the given value as a parameter to the statement. |
void |
setBlobTypeName(String blobTypeName)
The schema definition name for Types.BLOB . |
void |
setBoolean(PreparedStatement stmnt,
int idx,
boolean val)
Set the given value as a parameter to the statement. |
void |
setByte(PreparedStatement stmnt,
int idx,
byte val)
Set the given value as a parameter to the statement. |
void |
setBytes(PreparedStatement stmnt,
int idx,
byte[] val)
Set the given value as a parameter to the statement. |
void |
setCatalogSeparator(String sep)
|
void |
setChar(PreparedStatement stmnt,
int idx,
char val)
Set the given value as a parameter to the statement. |
void |
setCharacterStream(PreparedStatement stmnt,
int idx,
Reader val,
int length)
Set the given value as a parameter to the statement. |
void |
setCharTypeName(String charTypeName)
The schema definition name for Types.CHAR . |
void |
setClob(PreparedStatement stmnt,
int idx,
Clob val)
Set the given value as a parameter to the statement. |
void |
setClobString(PreparedStatement stmnt,
int idx,
String val)
Set the given value as a parameter to the statement. |
void |
setClobTypeName(String clobTypeName)
The schema definition name for Types.CLOB . |
void |
setConfiguration(Configuration conf)
Invoked prior to setting bean properties. |
void |
setCreatePrimaryKeys(boolean createPrimaryKeys)
If false, then do not specify that identifiers are primary keys. |
void |
setDate(PreparedStatement stmnt,
int idx,
Date val)
Set the given value as a parameter to the statement. |
void |
setDate(PreparedStatement stmnt,
int idx,
Date val,
Calendar cal)
Set the given value as a parameter to the statement. |
void |
setDateTypeName(String dateTypeName)
The schema definition name for Types.DATE . |
void |
setDBMetaData(DBMetaData meta)
Set the database metadata for this dictionary. |
void |
setDecimalTypeName(String decimalTypeName)
The schema definition name for Types.DECIMAL . |
void |
setDistinctTypeName(String distinctTypeName)
The schema definition name for Types.DISTINCT . |
void |
setDouble(PreparedStatement stmnt,
int idx,
double val)
Set the given value as a parameter to the statement. |
void |
setDoubleTypeName(String doubleTypeName)
The schema definition name for Types.DOUBLE . |
void |
setFloat(PreparedStatement stmnt,
int idx,
float val)
Set the given value as a parameter to the statement. |
void |
setFloatTypeName(String floatTypeName)
The schema definition name for Types.FLOAT . |
void |
setForUpdateClause(String forUpdateClause)
The clause that is used for issuing "SELECT ... |
void |
setInitializationSQL(String initializationSQL)
SQL that will be issued to the database whenever a connection is made. |
void |
setInt(PreparedStatement stmnt,
int idx,
int val)
Set the given value as a parameter to the statement. |
void |
setIntegerTypeName(String integerTypeName)
The schema definition name for Types.INTEGER . |
void |
setJavaObjectTypeName(String javaObjectTypeName)
The schema definition name for Types.JAVA_OBJECT . |
void |
setJoinSyntax(String syntax)
The join syntax to use as a string for automatic configuration: sql92, traditional, database |
protected void |
setJoinSyntaxConstant(int joinSyntax)
The SQL join syntax to use as one of the Join syntax constants. |
void |
setLastGeneratedKeyQuery(String lastGeneratedKeyQuery)
The query that will be used to query the last automatically generated key on the server. |
void |
setLocale(PreparedStatement stmnt,
int idx,
Locale val)
Set the given value as a parameter to the statement. |
void |
setLong(PreparedStatement stmnt,
int idx,
long val)
Set the given value as a parameter to the statement. |
void |
setLongVarbinaryTypeName(String longVarbinaryTypeName)
The schema definition name for Types.LONGVARBINARY . |
void |
setLongVarcharTypeName(String longVarcharTypeName)
The schema definition name for Types.LONGVARCHAR . |
void |
setMaxIndexesPerTable(int maxIndexesPerTable)
The maximum number of indexes that can be created for a single table, or Integer.MAX_VALUE if there is no limit. |
void |
setMaxKeyNameLength(Integer maxKeyNameLength)
The maximum number of characters in any key. |
void |
setNull(PreparedStatement stmnt,
int idx,
int colType)
Set the given value as a parameters to the statement. |
void |
setNullTypeName(String nullTypeName)
The schema definition name for Types.NULL . |
void |
setNumericTypeName(String numericTypeName)
The schema definition name for Types.NUMERIC . |
void |
setObject(PreparedStatement stmnt,
int idx,
Object val,
int colType)
Set the given value as a parameters to the statement. |
void |
setOtherTypeName(String otherTypeName)
The schema definition name for Types.OTHER . |
protected void |
setPlatform(String platform)
The database platform for this dictionary. |
void |
setRealTypeName(String realTypeName)
The schema definition name for Types.REAL . |
void |
setRef(PreparedStatement stmnt,
int idx,
Ref val)
Set the given value as a parameter to the statement. |
void |
setRefTypeName(String refTypeName)
The schema definition name for Types.REF . |
void |
setReservedWords(String reservedWords)
A comma-separated list of additional reserved words for this database. |
void |
setSchemaCase(String schemaCase)
Set how schema names (schema name, tables, database names) should be manipulated. |
void |
setShort(PreparedStatement stmnt,
int idx,
short val)
Set the given value as a parameter to the statement. |
void |
setSimulateLocking(boolean simulate)
If true, pessimistic locking will be allowed even if the database does not support locking. |
void |
setSmallintTypeName(String smallintTypeName)
The schema definition name for Types.SMALLINT . |
void |
setStorageLimitationsFatal(boolean storageLimitationsFatal)
Whether or not an exception should be thrown if value alteration needs to take place in order to be able to be stored in the database. |
void |
setStoreCharsAsNumbers(boolean charsAsNumbers)
If true, Java char values will be stored as numbers. |
void |
setStoreLargeNumbersAsStrings(boolean asStrings)
If true, BigDecimal s and BigInteger s will be stored as
strings. |
void |
setString(PreparedStatement stmnt,
int idx,
String val)
Set the given value as a parameter to the statement. |
void |
setStructTypeName(String structTypeName)
The schema definition name for Types.STRUCT . |
void |
setSupportsDeferredConstraints(boolean supportsDeferredConstraints)
|
void |
setSupportsForeignKeys(boolean supportsForeignKeys)
Whether this database supports foreign keys or not. |
void |
setSupportsLockingWithDistinctClause(boolean support)
Whether this database supports "FOR UPDATE" queries with a "DISTINCT" clause. |
void |
setSupportsLockingWithInnerJoin(boolean sel)
Whether this database supports "FOR UPDATE" queries with inner joins. |
void |
setSupportsLockingWithMultipleTables(boolean support)
Whether this database supports "FOR UPDATE" queries with multiple tables. |
void |
setSupportsLockingWithOrderClause(boolean support)
Whether this database supports "FOR UPDATE" queries with "ORDER BY" clauses. |
void |
setSupportsLockingWithOuterJoin(boolean sel)
Whether this database supports "FOR UPDATE" queries with outer joins. |
void |
setSupportsMultipleNontransactionalResultSets(boolean sup)
Whether this dictionary supports multiple result sets outside of a transaction. |
void |
setSupportsNullTableForGetColumns(boolean sup)
If true, calls to ResultSet#getColumns can handle
a null table. |
void |
setSupportsNullTableForGetImportedKeys(boolean sup)
If true, calls to ResultSet#getImportedKeys can handle
a null table. |
void |
setSupportsNullTableForGetIndexInfo(boolean sup)
If true, calls to ResultSet#getIndexInfo can handle
a null table. |
void |
setSupportsNullTableForGetPrimaryKeys(boolean sup)
If true, calls to ResultSet#getPrimaryKeys can handle
a null table. |
void |
setSupportsSchemaForGetColumns(boolean sup)
Some drivers have problems with using the schema name in calls to DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String) . |
void |
setSupportsSchemaForGetTables(boolean sup)
Some drivers have problems with using the schema name in calls to DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) . |
void |
setSupportsSelectForUpdate(Boolean supportsSelectForUpdate)
Whether this dictionary supports "SELECT ... |
void |
setSystemSchemas(String schemaNames)
Set a comma-separated string of table names that are considered system schemas and should not be reflected on. |
void |
setSystemTables(String tableNames)
Set a comma-separated string of table names that are considered system tables and should not be reflected on. |
void |
setTableForUpdateClause(String tableForUpdateClause)
The per-table clause to append to each table alias in a SELECT. |
void |
setTableTypes(String types)
The table types to look for when reflecting on the schema, separated by commas. |
void |
setTime(PreparedStatement stmnt,
int idx,
Time val,
Calendar cal)
Set the given value as a parameter to the statement. |
void |
setTimestamp(PreparedStatement stmnt,
int idx,
Timestamp val,
Calendar cal)
Set the given value as a parameter to the statement. |
void |
setTimestampTypeName(String timestampTypeName)
The schema definition name for Types.TIMESTAMP . |
void |
setTimeTypeName(String timeTypeName)
The schema definition name for Types.TIME . |
void |
setTinyintTypeName(String tinyintTypeName)
The schema definition name for Types.TINYINT . |
void |
setup(Select sel)
Configure the result set type and concurrency for the given select, if needed. |
void |
setUseGetBestRowIdentifierForPrimaryKeys(boolean useBestRow)
|
void |
setUseGetBytesForBlobs(boolean useGetBytesForBlobs)
If true, use ResultSet.getBytes(int) for blobs. |
void |
setUseGetObjectForBlobs(boolean useGetObjectForBlobs)
If true, use ResultSet.getObject(int) to obtain blob data. |
void |
setUseSchemaName(boolean useSchemaName)
Whether to use the schema name when constructing a full table name. |
void |
setUseSetBytesForBlobs(boolean useSetBytesForBlobs)
If true, use PreparedStatement.setBytes(int, byte[]) for blobs. |
void |
setUseStringsForClobs(boolean useStringsForClobs)
If true, then use ResultSet.getString(int) and
PreparedStatement.setString(int, java.lang.String) for clob handling. |
void |
setValidationSQL(String sql)
Simple SQL used to validate connections. |
void |
setVarbinaryTypeName(String varbinaryTypeName)
The schema definition name for Types.VARBINARY . |
void |
setVarcharTypeName(String varcharTypeName)
The schema definition name for Types.VARCHAR . |
void |
startConfiguration()
Invoked before bean property configuration is begun on this object. |
protected void |
storageWarning(Object orig,
Object converted)
Warn that a particular value could not be stored precisely. |
boolean |
supportsAutoIncrement()
Return true if this dictionary supports auto increment columns. |
boolean |
supportsForeignKey(ForeignKey fk)
Return true if the database supports the given foreign key. |
boolean |
supportsSelectForUpdate()
Whether locking on queries is supported; returns the metadata's reported value by default. |
protected boolean |
supportsSizeInColumnDefinition(Column col,
String name)
Returns true if a schema definition statement supports appending the size after the column type. |
boolean |
supportsTotalCountsForBatch()
Returns true if Statement.executeBatch() will
return an array with a single integer that represents the
total number rows updated by the batch execution. |
boolean |
supportsUpdateCountsForBatch()
Return true if the database returns meaningful update counts on batched statements. |
SQLBuffer |
toNativeJoin(Join join)
Use the given join instance to create SQL joining its tables in the database's native syntax. |
SQLBuffer |
toSelect(Select sel)
Create a SELECT statement in the proper join syntax for the given instance. |
SQLBuffer |
toSelect(SQLBuffer selects,
SQLBuffer from,
SQLBuffer where,
SQLBuffer order,
boolean distinct,
boolean forUpdate)
Combine the given components into a SELECT statement. |
SQLBuffer |
toSQL92Join(Join join,
boolean forUpdate,
boolean first)
Use the given join instance to create SQL joining its tables in the SQL92 style. |
SQLBuffer |
toTraditionalJoin(Join join)
Use the given join instance to create SQL joining its tables in the traditional style. |
protected void |
warnSupportedDictionary()
If this dictionary is not supported, issue a warning. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String SCHEMA_CASE_UPPER
setSchemaCase
that indicates that
schema names should always be converted to upper-case.public static final String SCHEMA_CASE_LOWER
setSchemaCase
that indicates that
schema names should always be converted to lower-case.public static final String SCHEMA_CASE_PRESERVE
setSchemaCase
that indicates that
no changes should be made to the specified schema name.public static final String SCHEMA_CASE_DEFAULT
setSchemaCase
that indicates that
no changes should be made to the specified schema name.protected static final int NANO
protected static final int MICRO
protected static final int MILLI
protected static final int CENTI
protected static final int DECI
protected static final int SEC
Constructor Detail |
public DBDictionary()
Method Detail |
public JDBCConfiguration getConfiguration()
public DBMetaData getDBMetaData()
public void setDBMetaData(DBMetaData meta) throws SQLException
protected void warnSupportedDictionary()
public boolean isSupported()
protected void setPlatform(String platform)
public String getPlatform()
public int getJoinSyntaxConstant()
Join
syntax constants.protected void setJoinSyntaxConstant(int joinSyntax)
Join
syntax constants.public String getJoinSyntax()
sql92, traditional, database
public void setJoinSyntax(String syntax)
sql92, traditional, database
public boolean getStoreCharsAsNumbers()
public void setStoreCharsAsNumbers(boolean charsAsNumbers)
public boolean getStoreLargeNumbersAsStrings()
BigDecimal
s and BigInteger
s will be stored as
strings. Defaults to false.public void setStoreLargeNumbersAsStrings(boolean asStrings)
BigDecimal
s and BigInteger
s will be stored as
strings. Defaults to false.public String getTableTypes()
public void setTableTypes(String types)
public void setUseSetBytesForBlobs(boolean useSetBytesForBlobs)
PreparedStatement.setBytes(int, byte[])
for blobs.public boolean getUseSetBytesForBlobs()
PreparedStatement.setBytes(int, byte[])
for blobs.public void setUseGetBytesForBlobs(boolean useGetBytesForBlobs)
ResultSet.getBytes(int)
for blobs.public boolean getUseGetBytesForBlobs()
ResultSet.getBytes(int)
for blobs.public void setUseGetObjectForBlobs(boolean useGetObjectForBlobs)
ResultSet.getObject(int)
to obtain blob data.public boolean getUseGetObjectForBlobs()
ResultSet.getObject(int)
to obtain blob data.public void setCreatePrimaryKeys(boolean createPrimaryKeys)
public boolean getCreatePrimaryKeys()
public void setUseStringsForClobs(boolean useStringsForClobs)
ResultSet.getString(int)
and
PreparedStatement.setString(int, java.lang.String)
for clob handling. Otherwise,
use ResultSet.getClob(int)
and
PreparedStatement.setCharacterStream(int, java.io.Reader, int)
.public boolean getUseStringsForClobs()
public void setSupportsDeferredConstraints(boolean supportsDeferredConstraints)
public boolean getSupportsDeferredConstraints()
public void setSupportsForeignKeys(boolean supportsForeignKeys)
public boolean getSupportsForeignKeys()
public void setStorageLimitationsFatal(boolean storageLimitationsFatal)
public boolean getStorageLimitationsFatal()
public void setSchemaCase(String schemaCase)
schemaCase
- one of SCHEMA_CASE_PRESERVE
,
SCHEMA_CASE_LOWER
,
SCHEMA_CASE_UPPER
,
or SCHEMA_CASE_DEFAULT
public String getSchemaCase()
SCHEMA_CASE_PRESERVE
,
SCHEMA_CASE_LOWER
, SCHEMA_CASE_UPPER
, or
SCHEMA_CASE_DEFAULT
protected String convertSchemaCase(String objectName)
getSchemaCase()
public boolean getSimulateLocking()
public void setSimulateLocking(boolean simulate)
public int getBatchLimit()
public void setBatchLimit(int batch)
public void setBatchParameterLimit(int batchParameterLimit)
public int getBatchParameterLimit()
public Collection getSystemTables()
public void setSystemTables(String tableNames)
public void addSystemTable(String tableName)
public Collection getSystemSchemas()
public void setSystemSchemas(String schemaNames)
public void addSystemSchema(String schemaName)
public String getValidationSQL()
public void setValidationSQL(String sql)
public boolean supportsUpdateCountsForBatch()
public boolean supportsTotalCountsForBatch()
Statement.executeBatch()
will
return an array with a single integer that represents the
total number rows updated by the batch execution.public String getCatalogSeparator()
setCatalogSeparator(java.lang.String)
.public void setCatalogSeparator(String sep)
public String getFullName(Table table)
getCatalogSeparator()
).public String getFullName(Index index)
getCatalogSeparator()
).public boolean supportsForeignKey(ForeignKey fk)
ForeignKey.ACTION_NONE
and checks the key's deferrability
against the return value of #supportsDeferredConstraints
.public boolean supportsSelectForUpdate()
public Array getArray(ResultSet rs, int column) throws SQLException
public InputStream getAsciiStream(ResultSet rs, int column) throws SQLException
public BigDecimal getBigDecimal(ResultSet rs, int column) throws SQLException
public BigInteger getBigInteger(ResultSet rs, int column) throws SQLException
public InputStream getBinaryStream(ResultSet rs, int column) throws SQLException
public Blob getBlob(ResultSet rs, int column) throws SQLException
public InputStream getBlobStream(ResultSet rs, int column) throws SQLException
InputStream
for the blob data specified
in the ResultSet
.public Object getBlobObject(ResultSet rs, int column) throws SQLException
public boolean getBoolean(ResultSet rs, int column) throws SQLException
public byte getByte(ResultSet rs, int column) throws SQLException
public byte[] getBytes(ResultSet rs, int column) throws SQLException
public char getChar(ResultSet rs, int column) throws SQLException
public Reader getCharacterStream(ResultSet rs, int column) throws SQLException
public Clob getClob(ResultSet rs, int column) throws SQLException
public String getClobString(ResultSet rs, int column) throws SQLException
public Date getDate(ResultSet rs, int column) throws SQLException
Timestamp
by default.public Date getDate(ResultSet rs, int column, Calendar cal) throws SQLException
public double getDouble(ResultSet rs, int column) throws SQLException
public float getFloat(ResultSet rs, int column) throws SQLException
public int getInt(ResultSet rs, int column) throws SQLException
public Locale getLocale(ResultSet rs, int column) throws SQLException
public long getLong(ResultSet rs, int column) throws SQLException
public Object getObject(ResultSet rs, int column, Map map) throws SQLException
public Ref getRef(ResultSet rs, int column, Map map) throws SQLException
public short getShort(ResultSet rs, int column) throws SQLException
public String getString(ResultSet rs, int column) throws SQLException
public Time getTime(ResultSet rs, int column, Calendar cal) throws SQLException
public Timestamp getTimestamp(ResultSet rs, int column, Calendar cal) throws SQLException
protected void storageWarning(Object orig, Object converted)
public void setArray(PreparedStatement stmnt, int idx, Array val) throws SQLException
public void setAsciiStream(PreparedStatement stmnt, int idx, InputStream val, int length) throws SQLException
public void setBigDecimal(PreparedStatement stmnt, int idx, BigDecimal val) throws SQLException
public void setBigInteger(PreparedStatement stmnt, int idx, BigInteger val) throws SQLException
public void setBinaryStream(PreparedStatement stmnt, int idx, InputStream val, int length) throws SQLException
public void setBlob(PreparedStatement stmnt, int idx, Blob val) throws SQLException
public void setBlobObject(PreparedStatement stmnt, int idx, Object val) throws SQLException
serialize(java.lang.Object)
method to serialize the value.public byte[] serialize(Object val) throws SQLException
public void setBoolean(PreparedStatement stmnt, int idx, boolean val) throws SQLException
public void setByte(PreparedStatement stmnt, int idx, byte val) throws SQLException
public void setBytes(PreparedStatement stmnt, int idx, byte[] val) throws SQLException
public void setChar(PreparedStatement stmnt, int idx, char val) throws SQLException
public void setCharacterStream(PreparedStatement stmnt, int idx, Reader val, int length) throws SQLException
public void setClob(PreparedStatement stmnt, int idx, Clob val) throws SQLException
public void setClobString(PreparedStatement stmnt, int idx, String val) throws SQLException
public void setDate(PreparedStatement stmnt, int idx, Date val) throws SQLException
Timestamp
by default.public void setDate(PreparedStatement stmnt, int idx, Date val, Calendar cal) throws SQLException
public void setDouble(PreparedStatement stmnt, int idx, double val) throws SQLException
public void setFloat(PreparedStatement stmnt, int idx, float val) throws SQLException
public void setInt(PreparedStatement stmnt, int idx, int val) throws SQLException
public void setLong(PreparedStatement stmnt, int idx, long val) throws SQLException
public void setLocale(PreparedStatement stmnt, int idx, Locale val) throws SQLException
public void setNull(PreparedStatement stmnt, int idx, int colType) throws SQLException
Types
.public void setObject(PreparedStatement stmnt, int idx, Object val, int colType) throws SQLException
Types
.public void setRef(PreparedStatement stmnt, int idx, Ref val) throws SQLException
public void setShort(PreparedStatement stmnt, int idx, short val) throws SQLException
public void setString(PreparedStatement stmnt, int idx, String val) throws SQLException
public void setTime(PreparedStatement stmnt, int idx, Time val, Calendar cal) throws SQLException
public void setTimestamp(PreparedStatement stmnt, int idx, Timestamp val, Calendar cal) throws SQLException
protected int getDatePrecision()
NANO
, MICRO
, MILLI
, CENTI
,
DECI
, SEC
. Returns MILLI
by default.public int getJDBCType(int metaTypeCode, boolean lob)
Types
constant for the given
FieldMapping
constant.public boolean canBatch(Column col)
public int getPreferredType(int type)
Types
type for the given one. Returns
the given type by default.public void configureReflectedColumn(Column col, String typeName)
DatabaseMetaData
.col
- the Column
to configuretypeName
- the TYPE_NAME as reported by the metadataprotected String getTypeName(Column col)
Types
. Defaults to using the DBMetaData
.protected String appendSize(Column col, String typeName)
protected String replaceSize(Column col, String typeName)
protected String getSizeClause(Column col)
protected boolean supportsSizeInColumnDefinition(Column col, String name)
public void setup(Select sel)
public SQLBuffer toSelect(Select sel)
public boolean canLock(Select select)
public SQLBuffer toSelect(SQLBuffer selects, SQLBuffer from, SQLBuffer where, SQLBuffer order, boolean distinct, boolean forUpdate)
protected SQLBuffer getSelects(Select sel)
protected SQLBuffer getOrderings(Select sel, SQLBuffer selectSQL)
protected SQLBuffer getFrom(Select sel)
protected SQLBuffer getWhere(Select sel)
public SQLBuffer toTraditionalJoin(Join join)
public SQLBuffer toSQL92Join(Join join, boolean forUpdate, boolean first)
public SQLBuffer toNativeJoin(Join join)
public String getValidTableName(String name, Schema schema)
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)
public int getMaxTableNameLength()
public String getValidColumnName(String name, Table table)
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)
public int getMaxColumnNameLength()
public String getValidPrimaryKeyName(String name, Table table)
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)
public int getMaxPrimaryKeyNameLength()
public int maxKeyNameLength()
public int getMaxCharacterFieldLength()
public String getValidForeignKeyName(String name, Table table, Table toTable)
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)
public int getMaxForeignKeyNameLength()
public String getValidIndexName(String name, Table table)
makeNameValid(java.lang.String, kodo.jdbc.schema.NameSet, int)
public int getMaxIndexNameLength()
public String makeNameValid(String name, NameSet set, int maxLen)
public boolean isReserved(String name)
public Collection getReservedKeywords()
public void setReservedWords(String reservedWords)
public String getReservedWords()
public String[] getCreateTableSQL(Table table)
public String[] getDropTableSQL(Table table)
DROP TABLE <table name>
by default.public String[] getCreateIndexSQL(Index index)
CREATE [UNIQUE] INDEX <index name> ON <table name>
(<col list>)
by default.public String[] getDropIndexSQL(Index index)
DROP INDEX <index name>
by default.public String[] getAddColumnSQL(Column column)
DBMetaData
is checked for support automatically. Returns
ALTER TABLE <table name> ADD (<col dec>)
by default.public String[] getDropColumnSQL(Column column)
DBMetaData
is checked for support automatically. Returns
ALTER TABLE <table name> DROP COLUMN <col name>
by default.public String[] getAddPrimaryKeySQL(PrimaryKey pk)
ALTER TABLE <table name> ADD
<pk cons sql >
by default.public String[] getDropPrimaryKeySQL(PrimaryKey pk)
ALTER TABLE <table name> DROP CONSTRAINT
<pk name>
by default.public String[] getAddForeignKeySQL(ForeignKey fk)
ALTER TABLE <table name> ADD
<fk cons sql >
by default.public String[] getDropForeignKeySQL(ForeignKey fk)
ALTER TABLE <table name> DROP CONSTRAINT
<fk name>
by default.public void refSchemaComponents(Table table)
protected String getDeclareColumnSQL(Column col, boolean alter)
getCreateTableSQL(kodo.jdbc.schema.Table)
and
getAddColumnSQL(kodo.jdbc.schema.Column)
.protected String getPrimaryKeyConstraintSQL(PrimaryKey pk)
getCreateTableSQL(kodo.jdbc.schema.Table)
and
getAddPrimaryKeySQL(kodo.jdbc.schema.PrimaryKey)
. Returns
CONSTRAINT <pk name> PRIMARY KEY (<col list>)
by default.protected boolean getConstraintNameBeforeDeclaration()
protected String getForeignKeyConstraintSQL(ForeignKey fk)
getCreateTableSQL(kodo.jdbc.schema.Table)
and getAddForeignKeySQL(kodo.jdbc.schema.ForeignKey)
. Returns
CONSTRAINT <cons name> FOREIGN KEY (<col list>)
REFERENCES <foreign table> (<col list>)
[ON DELETE <action>]
by default.protected String getForeignKeyActionName(int action)
CASCADE
for
ForeignKey.ACTION_CASCADE
, SET NULL
for
ForeignKey.ACTION_NULL
, SET DEFAULT
for
ForeignKey.ACTION_DEFAULT
, and null for
ForeignKey.ACTION_EXCEPTION
. Any other action causes an
IllegalArgumentException
.public boolean isSystemTable(String name, String schema, boolean targetSchema)
name
- the table nameschema
- the table schema; may be nulltargetSchema
- if true, then the given schema was listed by
the user as one of his JDO schemaspublic boolean isSystemIndex(String name, Table table)
name
- the index nametable
- the index tablepublic TableInfo[] getTables(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) throws SQLException
DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
.protected TableInfo newTableInfo(ResultSet rs) throws SQLException
TableInfo
from the given ResultSet
public ColumnInfo[] getColumns(DatabaseMetaData meta, String catalog, String schemaName, String tableName, String columnName, Connection conn) throws SQLException
DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
.protected ColumnInfo newColumnInfo(ResultSet rs) throws SQLException
ColumnInfo
from the given ResultSet
public PrimaryKeyInfo[] getPrimaryKeys(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) throws SQLException
PrimaryKeyInfo
for the specified
schema objects.protected PrimaryKeyInfo[] getPrimaryKeysFromGetPrimaryKeys(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) throws SQLException
protected PrimaryKeyInfo[] getPrimaryKeysFromBestRowIdentifier(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) throws SQLException
protected PrimaryKeyInfo newPrimaryKeyInfo(ResultSet rs) throws SQLException
PrimaryKeyInfo
from the given ResultSet
public IndexInfo[] getIndexInfo(DatabaseMetaData meta, String catalog, String schemaName, String tableName, boolean unique, boolean approx, Connection conn) throws SQLException
DatabaseMetaData.getIndexInfo(java.lang.String, java.lang.String, java.lang.String, boolean, boolean)
, though only the
TABLE_SCHEM, TABLE_NAME, NON_UNIQUE, INDEX_NAME,
COLUMN_NAME
columns are required.protected IndexInfo newIndexInfo(ResultSet rs) throws SQLException
IndexInfo
from the given ResultSet
public ForeignKeyInfo[] getImportedKeys(DatabaseMetaData meta, String catalog, String schemaName, String tableName, Connection conn) throws SQLException
DatabaseMetaData.getImportedKeys(java.lang.String, java.lang.String, java.lang.String)
, though only the
PKTABLE_SCHEM, PKTABLE_NAME, PKCOLUMN_NAME, FKTABLE_SCHEM,
FKTABLE_NAME, FKCOLUMN_NAME, KEY_SEQ, DELETE_RULE, FK_NAME,
DEFERRABILITY
columns are required.protected ForeignKeyInfo newForeignKeyInfo(ResultSet rs) throws SQLException
ForeignKeyInfo
from the given ResultSet
protected String getTableNameForMetadata(String tableName)
DatabaseMetaData
.protected String getSchemaNameForMetadata(String schemaName)
DatabaseMetaData
.protected String getCatalogNameForMetadata(String catalogName)
DatabaseMetaData
.protected String getColumnNameForMetadata(String columnName)
DatabaseMetaData
.public boolean supportsAutoIncrement()
public void setLastGeneratedKeyQuery(String lastGeneratedKeyQuery)
public String getLastGeneratedKeyQuery()
public long getGeneratedKey(Column col, Connection conn) throws SQLException
getLastGeneratedKeyQuery()
returns null.public String getLastGeneratedKeyQuery(Column column)
public void setAutoIncrementTypeName(String autoIncrementTypeName)
public String getAutoIncrementTypeName()
public void setAutoIncrementClause(String autoIncrementClause)
public String getAutoIncrementClause()
public ClassMapping replaceMapping(ClassMapping mapping)
public FieldMapping replaceMapping(FieldMapping mapping)
public MappingFactory replaceMappingFactory(MappingFactory factory)
public SchemaFactory replaceSchemaFactory(SchemaFactory factory)
public void setConfiguration(Configuration conf)
Configurable
setConfiguration
in interface Configurable
public void startConfiguration()
Configurable
startConfiguration
in interface Configurable
public void endConfiguration()
Configurable
endConfiguration
in interface Configurable
public Connection decorate(Connection conn) throws SQLException
getInitializationSQL()
method does
not return null.decorate
in interface ConnectionDecorator
public void setBigintTypeName(String bigintTypeName)
Types.BIGINT
.public String getBigintTypeName()
Types.BIGINT
.public void setBinaryTypeName(String binaryTypeName)
Types.BINARY
.public String getBinaryTypeName()
Types.BINARY
.public void setBitTypeName(String bitTypeName)
Types.BIT
.public String getBitTypeName()
Types.BIT
.public void setBlobTypeName(String blobTypeName)
Types.BLOB
.public String getBlobTypeName()
Types.BLOB
.public void setCharTypeName(String charTypeName)
Types.CHAR
.public String getCharTypeName()
Types.CHAR
.public void setClobTypeName(String clobTypeName)
Types.CLOB
.public String getClobTypeName()
Types.CLOB
.public void setDateTypeName(String dateTypeName)
Types.DATE
.public String getDateTypeName()
Types.DATE
.public void setDecimalTypeName(String decimalTypeName)
Types.DECIMAL
.public String getDecimalTypeName()
Types.DECIMAL
.public void setDistinctTypeName(String distinctTypeName)
Types.DISTINCT
.public String getDistinctTypeName()
Types.DISTINCT
.public void setDoubleTypeName(String doubleTypeName)
Types.DOUBLE
.public String getDoubleTypeName()
Types.DOUBLE
.public void setFloatTypeName(String floatTypeName)
Types.FLOAT
.public String getFloatTypeName()
Types.FLOAT
.public void setIntegerTypeName(String integerTypeName)
Types.INTEGER
.public String getIntegerTypeName()
Types.INTEGER
.public void setJavaObjectTypeName(String javaObjectTypeName)
Types.JAVA_OBJECT
.public String getJavaObjectTypeName()
Types.JAVA_OBJECT
.public void setLongVarbinaryTypeName(String longVarbinaryTypeName)
Types.LONGVARBINARY
.public String getLongVarbinaryTypeName()
Types.LONGVARBINARY
.public void setLongVarcharTypeName(String longVarcharTypeName)
Types.LONGVARCHAR
.public String getLongVarcharTypeName()
Types.LONGVARCHAR
.public void setNullTypeName(String nullTypeName)
Types.NULL
.public String getNullTypeName()
Types.NULL
.public void setNumericTypeName(String numericTypeName)
Types.NUMERIC
.public String getNumericTypeName()
Types.NUMERIC
.public void setOtherTypeName(String otherTypeName)
Types.OTHER
.public String getOtherTypeName()
Types.OTHER
.public void setRealTypeName(String realTypeName)
Types.REAL
.public String getRealTypeName()
Types.REAL
.public void setRefTypeName(String refTypeName)
Types.REF
.public String getRefTypeName()
Types.REF
.public void setSmallintTypeName(String smallintTypeName)
Types.SMALLINT
.public String getSmallintTypeName()
Types.SMALLINT
.public void setStructTypeName(String structTypeName)
Types.STRUCT
.public String getStructTypeName()
Types.STRUCT
.public void setTimeTypeName(String timeTypeName)
Types.TIME
.public String getTimeTypeName()
Types.TIME
.public void setTimestampTypeName(String timestampTypeName)
Types.TIMESTAMP
.public String getTimestampTypeName()
Types.TIMESTAMP
.public void setTinyintTypeName(String tinyintTypeName)
Types.TINYINT
.public String getTinyintTypeName()
Types.TINYINT
.public void setVarbinaryTypeName(String varbinaryTypeName)
Types.VARBINARY
.public String getVarbinaryTypeName()
Types.VARBINARY
.public void setVarcharTypeName(String varcharTypeName)
Types.VARCHAR
.public String getVarcharTypeName()
Types.VARCHAR
.public void setUseGetBestRowIdentifierForPrimaryKeys(boolean useBestRow)
public boolean getUseGetBestRowIdentifierForPrimaryKeys()
public void setSupportsMultipleNontransactionalResultSets(boolean sup)
public boolean getSupportsMultipleNontransactionalResultSets()
public void setForUpdateClause(String forUpdateClause)
public String getForUpdateClause()
public void setSupportsSelectForUpdate(Boolean supportsSelectForUpdate)
public Boolean getSupportsSelectForUpdate()
public void setMaxIndexesPerTable(int maxIndexesPerTable)
Integer.MAX_VALUE
if there is no limit.public int getMaxIndexesPerTable()
Integer.MAX_VALUE
if there is no limit.public void setMaxKeyNameLength(Integer maxKeyNameLength)
public Integer getMaxKeyNameLength()
public void setSupportsLockingWithDistinctClause(boolean support)
public boolean getSupportsLockingWithDistinctClause()
public void setSupportsLockingWithMultipleTables(boolean support)
public boolean getSupportsLockingWithMultipleTables()
public void setSupportsLockingWithOrderClause(boolean support)
public boolean getSupportsLockingWithOrderClause()
public void setTableForUpdateClause(String tableForUpdateClause)
public String getTableForUpdateClause()
public void setSupportsLockingWithOuterJoin(boolean sel)
public boolean getSupportsLockingWithOuterJoin()
public void setSupportsLockingWithInnerJoin(boolean sel)
public boolean getSupportsLockingWithInnerJoin()
public void setSupportsNullTableForGetColumns(boolean sup)
ResultSet#getColumns
can handle
a null table.public boolean getSupportsNullTableForGetColumns()
ResultSet#getColumns
can handle
a null table.public void setSupportsNullTableForGetIndexInfo(boolean sup)
ResultSet#getIndexInfo
can handle
a null table.public boolean getSupportsNullTableForGetIndexInfo()
ResultSet#getIndexInfo
can handle
a null table.public void setSupportsNullTableForGetImportedKeys(boolean sup)
ResultSet#getImportedKeys
can handle
a null table.public boolean getSupportsNullTableForGetImportedKeys()
ResultSet#getImportedKeys
can handle
a null table.public void setSupportsNullTableForGetPrimaryKeys(boolean sup)
ResultSet#getPrimaryKeys
can handle
a null table.public boolean getSupportsNullTableForGetPrimaryKeys()
ResultSet#getPrimaryKeys
can handle
a null table.public void setInitializationSQL(String initializationSQL)
public String getInitializationSQL()
public void setUseSchemaName(boolean useSchemaName)
public boolean getUseSchemaName()
public void setSupportsSchemaForGetTables(boolean sup)
DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
. If false, disable
the use of the schema name in these calls.public boolean getSupportsSchemaForGetTables()
DatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
. If false, disable
the use of the schema name in these calls.public void setSupportsSchemaForGetColumns(boolean sup)
DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
. If false, disable
the use of the schema name in these calls.public boolean getSupportsSchemaForGetColumns()
DatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
. If false, disable
the use of the schema name in these calls.
|
SolarMetric Kodo JDO 3.0.3 generated on February 20 2004 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |