|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
public class GenericTableMetaDataProvider
A generic implementation of the TableMetaDataProvider
that should provide enough features for all supported
databases.
Field Summary | |
---|---|
protected static Log |
logger
Logger available to subclasses |
Constructor Summary | |
---|---|
protected |
GenericTableMetaDataProvider(DatabaseMetaData databaseMetaData)
Constructor used to initialize with provided database meta data. |
Method Summary | |
---|---|
String |
catalogNameToUse(String catalogName)
Get the catalog name formatted based on metadata information. |
protected String |
getDatabaseVersion()
Provide access to version info for subclasses |
String |
getSimpleQueryForGetGeneratedKey(String tableName,
String keyColumnName)
Get the simple query to retreive a generated key |
List<TableParameterMetaData> |
getTableParameterMetaData()
Get the table parameter metadata that is currently used. |
void |
initializeWithMetaData(DatabaseMetaData databaseMetaData)
Initialize using the database metedata provided |
void |
initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData,
String catalogName,
String schemaName,
String tableName)
Initialize using provided database metadata, table and column information. |
boolean |
isGeneratedKeysColumnNameArraySupported()
Does this database support a column name String array for retreiving generated keys Connection.createStruct(String, Object[]) |
boolean |
isGetGeneratedKeysSimulated()
Does this database support a simple quey to retreive the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported DatabaseMetaData.supportsGetGeneratedKeys() |
boolean |
isGetGeneratedKeysSupported()
Does this database support the JDBC 3.0 feature of retreiving generated keys DatabaseMetaData.supportsGetGeneratedKeys() |
boolean |
isStoresLowerCaseIdentifiers()
Get whether identifiers use lower case |
boolean |
isStoresUpperCaseIdentifiers()
Get whether identifiers use upper case |
boolean |
isTableColumnMetaDataUsed()
Are we using the meta data for the table columns? |
String |
metaDataCatalogNameToUse(String catalogName)
Provide any modification of the catalog name passed in to match the meta data currently used. |
String |
metaDataSchemaNameToUse(String schemaName)
Provide any modification of the schema name passed in to match the meta data currently used. |
String |
schemaNameToUse(String schemaName)
Get the schema name formatted based on metadata information. |
void |
setGeneratedKeysColumnNameArraySupported(boolean generatedKeysColumnNameArraySupported)
Specify whether a column name array is supported for generated keys |
void |
setGetGeneratedKeysSupported(boolean getGeneratedKeysSupported)
Specify whether a column name array is supported for generated keys |
void |
setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)
Specify whether identifiers use lower case |
void |
setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)
Specify whether identifiers use upper case |
String |
tableNameToUse(String tableName)
Get the table name formatted based on metadata information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Log logger
Constructor Detail |
---|
protected GenericTableMetaDataProvider(DatabaseMetaData databaseMetaData) throws SQLException
databaseMetaData
- meta data to be used
SQLException
Method Detail |
---|
public boolean isStoresUpperCaseIdentifiers()
public void setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)
public boolean isStoresLowerCaseIdentifiers()
public void setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)
public boolean isTableColumnMetaDataUsed()
TableMetaDataProvider
isTableColumnMetaDataUsed
in interface TableMetaDataProvider
public List<TableParameterMetaData> getTableParameterMetaData()
TableMetaDataProvider
getTableParameterMetaData
in interface TableMetaDataProvider
TableParameterMetaData
public boolean isGetGeneratedKeysSupported()
TableMetaDataProvider
DatabaseMetaData.supportsGetGeneratedKeys()
isGetGeneratedKeysSupported
in interface TableMetaDataProvider
public boolean isGetGeneratedKeysSimulated()
TableMetaDataProvider
DatabaseMetaData.supportsGetGeneratedKeys()
isGetGeneratedKeysSimulated
in interface TableMetaDataProvider
public String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)
TableMetaDataProvider
getSimpleQueryForGetGeneratedKey
in interface TableMetaDataProvider
public void setGetGeneratedKeysSupported(boolean getGeneratedKeysSupported)
public boolean isGeneratedKeysColumnNameArraySupported()
TableMetaDataProvider
Connection.createStruct(String, Object[])
isGeneratedKeysColumnNameArraySupported
in interface TableMetaDataProvider
public void setGeneratedKeysColumnNameArraySupported(boolean generatedKeysColumnNameArraySupported)
public void initializeWithMetaData(DatabaseMetaData databaseMetaData) throws SQLException
TableMetaDataProvider
initializeWithMetaData
in interface TableMetaDataProvider
SQLException
public void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String tableName) throws SQLException
TableMetaDataProvider
initializeWithTableColumnMetaData
in interface TableMetaDataProvider
databaseMetaData
- used to retreive database specific informationcatalogName
- name of catalog to use or nullschemaName
- name of schema name to use or nulltableName
- name of the table
SQLException
public String tableNameToUse(String tableName)
TableMetaDataProvider
tableNameToUse
in interface TableMetaDataProvider
public String catalogNameToUse(String catalogName)
TableMetaDataProvider
catalogNameToUse
in interface TableMetaDataProvider
public String schemaNameToUse(String schemaName)
TableMetaDataProvider
schemaNameToUse
in interface TableMetaDataProvider
public String metaDataCatalogNameToUse(String catalogName)
TableMetaDataProvider
metaDataCatalogNameToUse
in interface TableMetaDataProvider
public String metaDataSchemaNameToUse(String schemaName)
TableMetaDataProvider
metaDataSchemaNameToUse
in interface TableMetaDataProvider
protected String getDatabaseVersion()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |