public class

TableMetaDataContext

extends Object
java.lang.Object
   ↳ org.springframework.jdbc.core.metadata.TableMetaDataContext

Class Overview

Class to manage context metadata used for the configuration and execution of operations on a database table.

Summary

Fields
protected final Log logger Logger available to subclasses
Public Constructors
TableMetaDataContext()
Public Methods
String createInsertString(String[] generatedKeyNames)
Build the insert string based on configuration and metadata information
int[] createInsertTypes()
Build the array of java.sql.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? 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 supportsGetGeneratedKeys()?
boolean isOverrideIncludeSynonymsDefault()
Are we overriding include synonyms default?
List<Object> matchInParameterValuesWithInsertColumns(Map<StringObject> 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.
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 Methods
List<String> reconcileColumnsToUse(List<String> declaredColumns, String[] generatedKeyNames)
Compare columns created from metadata with declared columns and return a reconciled list.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final Log logger

Logger available to subclasses

Public Constructors

public TableMetaDataContext ()

Public Methods

public String createInsertString (String[] generatedKeyNames)

Build the insert string based on configuration and metadata information

Returns
  • the insert string to be used

public int[] createInsertTypes ()

Build the array of java.sql.Types based on configuration and metadata information

Returns
  • the array of types to be used

public String getCatalogName ()

Get the name of the catalog for this context.

public String getSchemaName ()

Get the name of the schema for this context.

public 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. supportsGetGeneratedKeys()?

public List<String> getTableColumns ()

Get a List of the table column names.

public String getTableName ()

Get the name of the table for this context.

public boolean isAccessTableColumnMetaData ()

Are we accessing table meta data?

public boolean isGeneratedKeysColumnNameArraySupported ()

Is a column name String array for retrieving generated keys supported? createStruct(String, Object[])?

public boolean isGetGeneratedKeysSimulated ()

Does this database support simple query to retrieve generated keys when the JDBC 3.0 feature is not supported. supportsGetGeneratedKeys()?

public boolean isGetGeneratedKeysSupported ()

Does this database support the JDBC 3.0 feature of retrieving generated keys supportsGetGeneratedKeys()?

public boolean isOverrideIncludeSynonymsDefault ()

Are we overriding include synonyms default?

public List<Object> matchInParameterValuesWithInsertColumns (Map<StringObject> inParameters)

Match the provided column names and values with the list of columns used.

Parameters
inParameters the parameter names and values

public List<Object> matchInParameterValuesWithInsertColumns (SqlParameterSource parameterSource)

Match the provided column names and values with the list of columns used.

Parameters
parameterSource the parameter names and values

public void processMetaData (DataSource dataSource, List<String> declaredColumns, String[] generatedKeyNames)

Process the current meta data with the provided configuration options.

Parameters
dataSource the DataSource being used
declaredColumns any columns that are declared
generatedKeyNames name of generated keys

public void setAccessTableColumnMetaData (boolean accessTableColumnMetaData)

Specify whether we should access table column meta data.

public void setCatalogName (String catalogName)

Set the name of the catalog for this context.

public void setNativeJdbcExtractor (NativeJdbcExtractor nativeJdbcExtractor)

Set NativeJdbcExtractor to be used to retrieve the native connection.

public void setOverrideIncludeSynonymsDefault (boolean override)

Specify whether we should override default for accessing synonyms.

public void setSchemaName (String schemaName)

Set the name of the schema for this context.

public void setTableName (String tableName)

Set the name of the table for this context.

Protected Methods

protected List<String> reconcileColumnsToUse (List<String> declaredColumns, String[] generatedKeyNames)

Compare columns created from metadata with declared columns and return a reconciled list.

Parameters
declaredColumns declared column names
generatedKeyNames names of generated key columns