public class GenericTableMetaDataProvider extends Object implements TableMetaDataProvider
TableMetaDataProvider
that should provide
enough features for all supported databases.Modifier and Type | Field and Description |
---|---|
protected static Log |
logger
Logger available to subclasses
|
Modifier | Constructor and Description |
---|---|
protected |
GenericTableMetaDataProvider(DatabaseMetaData databaseMetaData)
Constructor used to initialize with provided database meta data.
|
Modifier and Type | Method and Description |
---|---|
String |
catalogNameToUse(String catalogName)
Get the catalog name formatted based on metadata information.
|
protected String |
getDatabaseVersion()
Provide access to version info for subclasses.
|
protected String |
getDefaultSchema()
Provide access to default schema for subclasses.
|
protected NativeJdbcExtractor |
getNativeJdbcExtractor() |
String |
getSimpleQueryForGetGeneratedKey(String tableName,
String keyColumnName)
Get the simple query to retrieve 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 retrieve 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() |
boolean |
isStoresUpperCaseIdentifiers() |
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) |
void |
setGetGeneratedKeysSupported(boolean getGeneratedKeysSupported) |
void |
setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)
Set the
NativeJdbcExtractor to use to retrieve the native connection if necessary |
void |
setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers) |
void |
setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers) |
String |
tableNameToUse(String tableName)
Get the table name formatted based on metadata information.
|
protected static final Log logger
protected GenericTableMetaDataProvider(DatabaseMetaData databaseMetaData) throws SQLException
databaseMetaData
- meta data to be usedSQLException
public void setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)
public boolean isStoresUpperCaseIdentifiers()
public void setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)
public boolean isStoresLowerCaseIdentifiers()
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 void setGeneratedKeysColumnNameArraySupported(boolean generatedKeysColumnNameArraySupported)
public boolean isGeneratedKeysColumnNameArraySupported()
TableMetaDataProvider
Connection.createStruct(String, Object[])
isGeneratedKeysColumnNameArraySupported
in interface TableMetaDataProvider
public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)
TableMetaDataProvider
NativeJdbcExtractor
to use to retrieve the native connection if necessarysetNativeJdbcExtractor
in interface TableMetaDataProvider
protected NativeJdbcExtractor getNativeJdbcExtractor()
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 retrieve database specific informationcatalogName
- name of catalog to use or nullschemaName
- name of schema name to use or nulltableName
- name of the tableSQLException
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 getDefaultSchema()
protected String getDatabaseVersion()