public class TableMetaDataContext extends Object
Constructor and Description |
---|
TableMetaDataContext() |
Modifier and Type | Method and Description |
---|---|
String |
createInsertString(String... generatedKeyNames)
Build the insert string based on configuration and meta-data information.
|
int[] |
createInsertTypes()
Build the array of
Types based on configuration and meta-data information. |
String |
getCatalogName()
Get the name of the catalog for this context.
|
String |
getSchemaName()
Get the name of the schema for this context.
|
String |
getSimpleQueryForGetGeneratedKey(String tableName,
String keyColumnName)
Does this database support a simple query to retrieve generated keys
when the JDBC 3.0 feature is not supported:
DatabaseMetaData.supportsGetGeneratedKeys() ? |
String |
getSimulationQueryForGetGeneratedKey(String tableName,
String keyColumnName)
Deprecated.
as of 4.3.15, in favor of
getSimpleQueryForGetGeneratedKey(java.lang.String, java.lang.String) |
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:
DatabaseMetaData.supportsGetGeneratedKeys() ? |
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 meta-data 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 |
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(@Nullable String tableName)
public void setCatalogName(@Nullable String catalogName)
@Nullable public String getCatalogName()
public void setSchemaName(@Nullable String schemaName)
public void setAccessTableColumnMetaData(boolean accessTableColumnMetaData)
public boolean isAccessTableColumnMetaData()
public void setOverrideIncludeSynonymsDefault(boolean override)
public boolean isOverrideIncludeSynonymsDefault()
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 meta-data information.public boolean isGetGeneratedKeysSupported()
DatabaseMetaData.supportsGetGeneratedKeys()
?public boolean isGetGeneratedKeysSimulated()
DatabaseMetaData.supportsGetGeneratedKeys()
?@Deprecated @Nullable public String getSimulationQueryForGetGeneratedKey(String tableName, String keyColumnName)
getSimpleQueryForGetGeneratedKey(java.lang.String, java.lang.String)
DatabaseMetaData.supportsGetGeneratedKeys()
?@Nullable public String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)
DatabaseMetaData.supportsGetGeneratedKeys()
?public boolean isGeneratedKeysColumnNameArraySupported()
Connection.createStruct(String, Object[])
?