Top Description Methods
org.springframework.jdbc.core.metadata

public Interface TableMetaDataProvider

Known Direct Implementers
org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider
Imports
java.sql.DatabaseMetaData, .SQLException, java.util.List, org.springframework.lang.Nullable

Interface specifying the API to be implemented by a class providing table meta-data.

This is intended for internal use by the Simple JDBC classes.

Authors
Thomas Risberg, Sam Brannen
Since
2.5

Method Summary

Modifier and TypeMethod and Description
public String
catalogNameToUse(String catalogName)

Get the catalog name formatted based on meta-data information.

public String
columnNameToUse(String columnName)

Get the column name formatted based on meta-data information.

public String

Returns:

database identifier quote string
getIdentifierQuoteString
()

Get the string used to quote SQL identifiers.

public String
getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)

Get the simple query to retrieve generated keys when the JDBC feature for retrieving generated keys is not supported.

public List<TableParameterMetaData>

Returns:

a List of TableParameterMetaData
getTableParameterMetaData
()

Get the table parameter meta-data that is currently used.

public void
initializeWithMetaData(DatabaseMetaData
used to retrieve database specific information
databaseMetaData
)

Initialize using the database meta-data provided.

public void
initializeWithTableColumnMetaData(DatabaseMetaData
used to retrieve database specific information
databaseMetaData
,
String
name of catalog to use (or null if none)
catalogName
,
String
name of schema name to use (or null if none)
schemaName
,
String
name of the table
tableName
)

Initialize using provided database meta-data, table and column information.

public boolean
isGeneratedKeysColumnNameArraySupported()

Does this database support a column name String array for retrieving generated keys?

public boolean
isGetGeneratedKeysSimulated()

Does this database support a simple query to retrieve generated keys when the JDBC feature for retrieving generated keys is not supported?

public boolean
isGetGeneratedKeysSupported()

Does this database support the JDBC feature for retrieving generated keys?

public boolean
isTableColumnMetaDataUsed()

Are we using the meta-data for the table columns?

public String
metaDataCatalogNameToUse(String catalogName)

Provide any modification of the catalog name passed in to match the meta-data currently used.

public String
metaDataSchemaNameToUse(String schemaName)

Provide any modification of the schema name passed in to match the meta-data currently used.

public String
schemaNameToUse(String schemaName)

Get the schema name formatted based on meta-data information.

public String
tableNameToUse(String tableName)

Get the table name formatted based on meta-data information.

Method Detail

catalogNameToUseback to summary
public String catalogNameToUse(String catalogName)

Get the catalog name formatted based on meta-data information.

This could include altering the case.

Annotations
@Nullable
columnNameToUseback to summary
public String columnNameToUse(String columnName)

Get the column name formatted based on meta-data information.

This could include altering the case.

Annotations
@Nullable
Since
6.1
getIdentifierQuoteStringback to summary
public String getIdentifierQuoteString()

Get the string used to quote SQL identifiers.

This method returns a space (" ") if identifier quoting is not supported.

Returns:String

database identifier quote string

Since
6.1
See Also
DatabaseMetaData#getIdentifierQuoteString()
getSimpleQueryForGetGeneratedKeyback to summary
public String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName)

Get the simple query to retrieve generated keys when the JDBC feature for retrieving generated keys is not supported.

Annotations
@Nullable
See Also
isGetGeneratedKeysSimulated()
getTableParameterMetaDataback to summary
public List<TableParameterMetaData> getTableParameterMetaData()

Get the table parameter meta-data that is currently used.

Returns:List<TableParameterMetaData>

a List of TableParameterMetaData

initializeWithMetaDataback to summary
public void initializeWithMetaData(DatabaseMetaData databaseMetaData) throws SQLException

Initialize using the database meta-data provided.

Parameters
databaseMetaData:DatabaseMetaData

used to retrieve database specific information

Exceptions
SQLException:
in case of initialization failure
initializeWithTableColumnMetaDataback to summary
public void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String tableName) throws SQLException

Initialize using provided database meta-data, table and column information.

This initialization can be turned off by specifying that column meta-data should not be used.

Parameters
databaseMetaData:DatabaseMetaData

used to retrieve database specific information

catalogName:String

name of catalog to use (or null if none)

schemaName:String

name of schema name to use (or null if none)

tableName:String

name of the table

Exceptions
SQLException:
in case of initialization failure
isGeneratedKeysColumnNameArraySupportedback to summary
public boolean isGeneratedKeysColumnNameArraySupported()

Does this database support a column name String array for retrieving generated keys?

See Also
java.sql.Connection#createStruct(String, Object[])
isGetGeneratedKeysSimulatedback to summary
public boolean isGetGeneratedKeysSimulated()

Does this database support a simple query to retrieve generated keys when the JDBC feature for retrieving generated keys is not supported?

See Also
isGetGeneratedKeysSupported(), getSimpleQueryForGetGeneratedKey(String, String)
isGetGeneratedKeysSupportedback to summary
public boolean isGetGeneratedKeysSupported()

Does this database support the JDBC feature for retrieving generated keys?

See Also
java.sql.DatabaseMetaData#supportsGetGeneratedKeys()
isTableColumnMetaDataUsedback to summary
public boolean isTableColumnMetaDataUsed()

Are we using the meta-data for the table columns?

metaDataCatalogNameToUseback to summary
public String metaDataCatalogNameToUse(String catalogName)

Provide any modification of the catalog name passed in to match the meta-data currently used.

The returned value will be used for meta-data lookups.

This could include altering the case used or providing a base catalog if none is provided.

Annotations
@Nullable
metaDataSchemaNameToUseback to summary
public String metaDataSchemaNameToUse(String schemaName)

Provide any modification of the schema name passed in to match the meta-data currently used.

The returned value will be used for meta-data lookups.

This could include altering the case used or providing a base schema if none is provided.

Annotations
@Nullable
schemaNameToUseback to summary
public String schemaNameToUse(String schemaName)

Get the schema name formatted based on meta-data information.

This could include altering the case.

Annotations
@Nullable
tableNameToUseback to summary
public String tableNameToUse(String tableName)

Get the table name formatted based on meta-data information.

This could include altering the case.

Annotations
@Nullable