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

public Class OracleTableMetaDataProvider

extends GenericTableMetaDataProvider
Class Inheritance
Imports
java.lang.reflect.Method, java.sql.CallableStatement, .Connection, .DatabaseMetaData, .SQLException, .Types, org.springframework.dao.InvalidDataAccessApiUsageException, org.springframework.lang.Nullable, org.springframework.util.ReflectionUtils

Oracle-specific implementation of the org.springframework.jdbc.core.metadata.TableMetaDataProvider. Supports a feature for including synonyms in the meta-data lookup. Also supports lookup of current schema using the sys_context.

Thanks to Mike Youngstrom and Bruce Campbell for submitting the original suggestion for the Oracle current schema lookup implementation.

Authors
Thomas Risberg, Juergen Hoeller
Since
3.0

Field Summary

Modifier and TypeField and Description
private final String
private final boolean
Inherited from org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider:
logger

Constructor Summary

AccessConstructor and Description
public
OracleTableMetaDataProvider(DatabaseMetaData
meta-data to be used
databaseMetaData
)

Constructor used to initialize with provided database meta-data.

public
OracleTableMetaDataProvider(DatabaseMetaData
meta-data to be used
databaseMetaData
,
boolean
whether to include synonyms
includeSynonyms
)

Constructor used to initialize with provided database meta-data.

Method Summary

Modifier and TypeMethod and Description
protected String
getDefaultSchema()

Overrides org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider.getDefaultSchema.

Provide access to the default schema for subclasses.

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
)

Overrides org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider.initializeWithTableColumnMetaData.

Implements org.springframework.jdbc.core.metadata.TableMetaDataProvider.initializeWithTableColumnMetaData.

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

private static String
Inherited from org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider:
catalogNameToUsecolumnNameToUsegetDatabaseVersiongetIdentifierQuoteStringgetSimpleQueryForGetGeneratedKeygetTableParameterMetaDatainitializeWithMetaDataisGeneratedKeysColumnNameArraySupportedisGetGeneratedKeysSimulatedisGetGeneratedKeysSupportedisStoresLowerCaseIdentifiersisStoresUpperCaseIdentifiersisTableColumnMetaDataUsedmetaDataCatalogNameToUsemetaDataSchemaNameToUseschemaNameToUsesetGeneratedKeysColumnNameArraySupportedsetGetGeneratedKeysSupportedsetStoresLowerCaseIdentifierssetStoresUpperCaseIdentifierstableNameToUse

Field Detail

defaultSchemaback to summary
private final String defaultSchema
Annotations
@Nullable
includeSynonymsback to summary
private final boolean includeSynonyms

Constructor Detail

OracleTableMetaDataProviderback to summary
public OracleTableMetaDataProvider(DatabaseMetaData databaseMetaData) throws SQLException

Constructor used to initialize with provided database meta-data.

Parameters
databaseMetaData:DatabaseMetaData

meta-data to be used

OracleTableMetaDataProviderback to summary
public OracleTableMetaDataProvider(DatabaseMetaData databaseMetaData, boolean includeSynonyms) throws SQLException

Constructor used to initialize with provided database meta-data.

Parameters
databaseMetaData:DatabaseMetaData

meta-data to be used

includeSynonyms:boolean

whether to include synonyms

Method Detail

getDefaultSchemaback to summary
protected String getDefaultSchema()

Overrides org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider.getDefaultSchema.

Doc from org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider.getDefaultSchema.

Provide access to the default schema for subclasses.

Annotations
@Override
@Nullable
initializeWithTableColumnMetaDataback to summary
public void initializeWithTableColumnMetaData(DatabaseMetaData databaseMetaData, String catalogName, String schemaName, String tableName) throws SQLException

Overrides org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider.initializeWithTableColumnMetaData.

Implements org.springframework.jdbc.core.metadata.TableMetaDataProvider.initializeWithTableColumnMetaData.

Doc from org.springframework.jdbc.core.metadata.TableMetaDataProvider.initializeWithTableColumnMetaData.

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

Annotations
@Override
Exceptions
SQLException:
in case of initialization failure
lookupDefaultSchemaback to summary
private static String lookupDefaultSchema(DatabaseMetaData databaseMetaData)
Annotations
@Nullable