public class TableMetaDataContext extends Object
Modifier and Type | Field and Description |
---|---|
protected Log |
logger
Logger available to subclasses
|
Constructor and Description |
---|
TableMetaDataContext() |
Modifier and Type | Method and Description |
---|---|
String |
createInsertString(String... generatedKeyNames)
Build the insert string based on configuration and metadata information
|
int[] |
createInsertTypes()
Build the array of
Types based on configuration and metadata information |
String |
getCatalogName()
Get the name of the catalog for this context.
|
String |
getSchemaName()
Get the name of the schema for this context.
|
String |
getSimulationQueryForGetGeneratedKey(String tableName,
String keyColumnName)
Does this database support simple query to retrieve generated keys
when the JDBC 3.0 feature is not supported.
|
List<String> |
getTableColumns()
Get a List of the table column names.
|
String |
getTableName()
Get the name of the table for this context.
|
boolean |
isAccessTableColumnMetaData()
Are we accessing table meta data?
|
boolean |
isGeneratedKeysColumnNameArraySupported()
Is a column name String array for retrieving generated keys supported?
Connection.createStruct(String, Object[]) ? |
boolean |
isGetGeneratedKeysSimulated()
Does this database support simple query to retrieve generated keys
when the JDBC 3.0 feature is not supported.
|
boolean |
isGetGeneratedKeysSupported()
Does this database support the JDBC 3.0 feature of retrieving generated keys
DatabaseMetaData.supportsGetGeneratedKeys() ? |
boolean |
isOverrideIncludeSynonymsDefault()
Are we overriding include synonyms default?
|
List<Object> |
matchInParameterValuesWithInsertColumns(Map<String,?> inParameters)
Match the provided column names and values with the list of columns used.
|
List<Object> |
matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource)
Match the provided column names and values with the list of columns used.
|
void |
processMetaData(DataSource dataSource,
List<String> declaredColumns,
String[] generatedKeyNames)
Process the current meta data with the provided configuration options.
|
protected List<String> |
reconcileColumnsToUse(List<String> declaredColumns,
String[] generatedKeyNames)
Compare columns created from metadata with declared columns and return a reconciled list.
|
void |
setAccessTableColumnMetaData(boolean accessTableColumnMetaData)
Specify whether we should access table column meta data.
|
void |
setCatalogName(String catalogName)
Set the name of the catalog for this context.
|
void |
setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)
Set
NativeJdbcExtractor to be used to retrieve the native connection. |
void |
setOverrideIncludeSynonymsDefault(boolean override)
Specify whether we should override default for accessing synonyms.
|
void |
setSchemaName(String schemaName)
Set the name of the schema for this context.
|
void |
setTableName(String tableName)
Set the name of the table for this context.
|
protected final Log logger
public void setTableName(String tableName)
public String getTableName()
public void setCatalogName(String catalogName)
public String getCatalogName()
public void setSchemaName(String schemaName)
public String getSchemaName()
public void setAccessTableColumnMetaData(boolean accessTableColumnMetaData)
public boolean isAccessTableColumnMetaData()
public void setOverrideIncludeSynonymsDefault(boolean override)
public boolean isOverrideIncludeSynonymsDefault()
public boolean isGetGeneratedKeysSupported()
DatabaseMetaData.supportsGetGeneratedKeys()
?public boolean isGetGeneratedKeysSimulated()
DatabaseMetaData.supportsGetGeneratedKeys()
?public String getSimulationQueryForGetGeneratedKey(String tableName, String keyColumnName)
DatabaseMetaData.supportsGetGeneratedKeys()
?public boolean isGeneratedKeysColumnNameArraySupported()
Connection.createStruct(String, Object[])
?public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)
NativeJdbcExtractor
to be used to retrieve the native connection.public void processMetaData(DataSource dataSource, List<String> declaredColumns, String[] generatedKeyNames)
dataSource
- the DataSource being useddeclaredColumns
- any columns that are declaredgeneratedKeyNames
- name of generated keysprotected List<String> reconcileColumnsToUse(List<String> declaredColumns, String[] generatedKeyNames)
declaredColumns
- declared column namesgeneratedKeyNames
- names of generated key columnspublic List<Object> matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource)
parameterSource
- the parameter names and valuespublic List<Object> matchInParameterValuesWithInsertColumns(Map<String,?> inParameters)
inParameters
- the parameter names and valuespublic String createInsertString(String... generatedKeyNames)
public int[] createInsertTypes()
Types
based on configuration and metadata information