public class TableMetaDataContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
accessTableColumnMetaData
should we access insert parameter meta data info or not
|
private java.lang.String |
catalogName
name of catalog for this context
|
private boolean |
generatedKeyColumnsUsed
are we using generated key columns
|
protected Log |
logger
Logger available to subclasses
|
private TableMetaDataProvider |
metaDataProvider
the provider of table meta data
|
private boolean |
overrideIncludeSynonymsDefault
should we override default for including synonyms for meta data lookups
|
private java.lang.String |
schemaName
name of schema for this context
|
private java.util.List<java.lang.String> |
tableColumns
List of columns objects to be used in this context
|
private java.lang.String |
tableName
name of table for this context
|
Constructor and Description |
---|
TableMetaDataContext() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createInsertString(java.lang.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 |
java.lang.String |
getCatalogName()
Get the name of the catalog for this context.
|
java.lang.String |
getSchemaName()
Get the name of the schema for this context.
|
java.lang.String |
getSimulationQueryForGetGeneratedKey(java.lang.String tableName,
java.lang.String keyColumnName)
Does this database support simple query to retrieve generated keys
when the JDBC 3.0 feature is not supported.
|
java.util.List<java.lang.String> |
getTableColumns()
Get a List of the table column names.
|
java.lang.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?
|
java.util.List<java.lang.Object> |
matchInParameterValuesWithInsertColumns(java.util.Map<java.lang.String,?> inParameters)
Match the provided column names and values with the list of columns used.
|
java.util.List<java.lang.Object> |
matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource)
Match the provided column names and values with the list of columns used.
|
void |
processMetaData(javax.sql.DataSource dataSource,
java.util.List<java.lang.String> declaredColumns,
java.lang.String[] generatedKeyNames)
Process the current meta data with the provided configuration options.
|
protected java.util.List<java.lang.String> |
reconcileColumnsToUse(java.util.List<java.lang.String> declaredColumns,
java.lang.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(java.lang.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(java.lang.String schemaName)
Set the name of the schema for this context.
|
void |
setTableName(java.lang.String tableName)
Set the name of the table for this context.
|
protected final Log logger
private java.lang.String tableName
private java.lang.String catalogName
private java.lang.String schemaName
private java.util.List<java.lang.String> tableColumns
private boolean accessTableColumnMetaData
private boolean overrideIncludeSynonymsDefault
private TableMetaDataProvider metaDataProvider
private boolean generatedKeyColumnsUsed
public void setTableName(java.lang.String tableName)
public java.lang.String getTableName()
public void setCatalogName(java.lang.String catalogName)
public java.lang.String getCatalogName()
public void setSchemaName(java.lang.String schemaName)
public java.lang.String getSchemaName()
public void setAccessTableColumnMetaData(boolean accessTableColumnMetaData)
public boolean isAccessTableColumnMetaData()
public void setOverrideIncludeSynonymsDefault(boolean override)
public boolean isOverrideIncludeSynonymsDefault()
public java.util.List<java.lang.String> getTableColumns()
public boolean isGetGeneratedKeysSupported()
DatabaseMetaData.supportsGetGeneratedKeys()
?public boolean isGetGeneratedKeysSimulated()
DatabaseMetaData.supportsGetGeneratedKeys()
?public java.lang.String getSimulationQueryForGetGeneratedKey(java.lang.String tableName, java.lang.String keyColumnName)
DatabaseMetaData.supportsGetGeneratedKeys()
?public boolean isGeneratedKeysColumnNameArraySupported()
Connection.createStruct(String, Object[])
?public void processMetaData(javax.sql.DataSource dataSource, java.util.List<java.lang.String> declaredColumns, java.lang.String[] generatedKeyNames)
dataSource
- the DataSource being useddeclaredColumns
- any columns that are declaredgeneratedKeyNames
- name of generated keysprotected java.util.List<java.lang.String> reconcileColumnsToUse(java.util.List<java.lang.String> declaredColumns, java.lang.String[] generatedKeyNames)
declaredColumns
- declared column namesgeneratedKeyNames
- names of generated key columnspublic java.util.List<java.lang.Object> matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource)
parameterSource
- the parameter names and valuespublic java.util.List<java.lang.Object> matchInParameterValuesWithInsertColumns(java.util.Map<java.lang.String,?> inParameters)
inParameters
- the parameter names and valuespublic java.lang.String createInsertString(java.lang.String... generatedKeyNames)
public int[] createInsertTypes()
Types
based on configuration and metadata information