Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.jdbc.core.metadata
Class GenericTableMetaDataProvider

    java.lang.Object
      org.springframework.jdbc.core.metadata.GenericTableMetaDataProvider

All Implemented Interfaces:
  TableMetaDataProvider

Direct Known Subclasses:
  DerbyTableMetaDataProvider, HsqlTableMetaDataProvider, OracleTableMetaDataProvider, PostgresTableMetaDataProvider

    public class GenericTableMetaDataProvider

extends java.lang.Object
implements TableMetaDataProvider

A generic implementation of the `TableMetaDataProvider` that should provide enough features for all supported databases.

Since:
  2.5
Author:
  Thomas Risberg

Field Summary
`protected static org.apache.commons.logging.Log` | `logger` Logger available to subclasses

Constructor Summary
`protected` | `GenericTableMetaDataProvider(java.sql.DatabaseMetaData databaseMetaData)` Constructor used to initialize with provided database meta data.

Method Summary
`java.lang.String` | `catalogNameToUse(java.lang.String catalogName)` Get the catalog name formatted based on metadata information.
`protected java.lang.String` | `getDatabaseVersion()` Provide access to version info for subclasses.
`protected java.lang.String` | `getDefaultSchema()` Provide access to default schema for subclasses.
`protected NativeJdbcExtractor` | `getNativeJdbcExtractor()`
`java.lang.String` | `getSimpleQueryForGetGeneratedKey(java.lang.String tableName, java.lang.String keyColumnName)` Get the simple query to retrieve a generated key
`java.util.List<TableParameterMetaData>` | `getTableParameterMetaData()` Get the table parameter metadata that is currently used.
`void` | `initializeWithMetaData(java.sql.DatabaseMetaData databaseMetaData)` Initialize using the database metedata provided
`void` | `initializeWithTableColumnMetaData(java.sql.DatabaseMetaData databaseMetaData, java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName)` Initialize using provided database metadata, table and column information.
`boolean` | `isGeneratedKeysColumnNameArraySupported()` Does this database support a column name String array for retreiving generated keys `Connection.createStruct(String, Object[])`
`boolean` | `isGetGeneratedKeysSimulated()` Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported `DatabaseMetaData.supportsGetGeneratedKeys()`
`boolean` | `isGetGeneratedKeysSupported()` Does this database support the JDBC 3.0 feature of retreiving generated keys `DatabaseMetaData.supportsGetGeneratedKeys()`
`boolean` | `isStoresLowerCaseIdentifiers()` Get whether identifiers use lower case
`boolean` | `isStoresUpperCaseIdentifiers()` Get whether identifiers use upper case
`boolean` | `isTableColumnMetaDataUsed()` Are we using the meta data for the table columns?
`java.lang.String` | `metaDataCatalogNameToUse(java.lang.String catalogName)` Provide any modification of the catalog name passed in to match the meta data currently used.
`java.lang.String` | `metaDataSchemaNameToUse(java.lang.String schemaName)` Provide any modification of the schema name passed in to match the meta data currently used.
`java.lang.String` | `schemaNameToUse(java.lang.String schemaName)` Get the schema name formatted based on metadata information.
`void` | `setGeneratedKeysColumnNameArraySupported(boolean generatedKeysColumnNameArraySupported)` Specify whether a column name array is supported for generated keys
`void` | `setGetGeneratedKeysSupported(boolean getGeneratedKeysSupported)` Specify whether a column name array is supported for generated keys
`void` | `setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)` Set the `NativeJdbcExtractor` to use to retrieve the native connection if necessary
`void` | `setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)` Specify whether identifiers use lower case.
`void` | `setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)` Specify whether identifiers use upper case
`java.lang.String` | `tableNameToUse(java.lang.String tableName)` Get the table name formatted based on metadata information.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### logger

    protected static final org.apache.commons.logging.Log logger

  Logger available to subclasses

Constructor Detail

### GenericTableMetaDataProvider

    protected GenericTableMetaDataProvider(java.sql.DatabaseMetaData databaseMetaData)
                                    throws java.sql.SQLException

  Constructor used to initialize with provided database meta data.

  Parameters:
    `databaseMetaData` - meta data to be used
  Throws:
    `java.sql.SQLException`

Method Detail

### setStoresUpperCaseIdentifiers

    public void setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)

  Specify whether identifiers use upper case

### isStoresUpperCaseIdentifiers

    public boolean isStoresUpperCaseIdentifiers()

  Get whether identifiers use upper case

### setStoresLowerCaseIdentifiers

    public void setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)

  Specify whether identifiers use lower case.

### isStoresLowerCaseIdentifiers

    public boolean isStoresLowerCaseIdentifiers()

  Get whether identifiers use lower case

### isTableColumnMetaDataUsed

    public boolean isTableColumnMetaDataUsed()

  Description copied from interface: `TableMetaDataProvider`
  Are we using the meta data for the table columns?

  Specified by:
    `isTableColumnMetaDataUsed` in interface `TableMetaDataProvider`

### getTableParameterMetaData

    public java.util.List<TableParameterMetaData> getTableParameterMetaData()

  Description copied from interface: `TableMetaDataProvider`
  Get the table parameter metadata that is currently used.

  Specified by:
    `getTableParameterMetaData` in interface `TableMetaDataProvider`
  Returns:
    List of `TableParameterMetaData`

### isGetGeneratedKeysSupported

    public boolean isGetGeneratedKeysSupported()

  Description copied from interface: `TableMetaDataProvider`
  Does this database support the JDBC 3.0 feature of retreiving generated keys `DatabaseMetaData.supportsGetGeneratedKeys()`

  Specified by:
    `isGetGeneratedKeysSupported` in interface `TableMetaDataProvider`

### isGetGeneratedKeysSimulated

    public boolean isGetGeneratedKeysSimulated()

  Description copied from interface: `TableMetaDataProvider`
  Does this database support a simple quey to retrieve the generated key whe the JDBC 3.0 feature of retreiving generated keys is not supported `DatabaseMetaData.supportsGetGeneratedKeys()`

  Specified by:
    `isGetGeneratedKeysSimulated` in interface `TableMetaDataProvider`

### getSimpleQueryForGetGeneratedKey

    public java.lang.String getSimpleQueryForGetGeneratedKey(java.lang.String tableName,
                                                             java.lang.String keyColumnName)

  Description copied from interface: `TableMetaDataProvider`
  Get the simple query to retrieve a generated key

  Specified by:
    `getSimpleQueryForGetGeneratedKey` in interface `TableMetaDataProvider`

### setGetGeneratedKeysSupported

    public void setGetGeneratedKeysSupported(boolean getGeneratedKeysSupported)

  Specify whether a column name array is supported for generated keys

### setGeneratedKeysColumnNameArraySupported

    public void setGeneratedKeysColumnNameArraySupported(boolean generatedKeysColumnNameArraySupported)

  Specify whether a column name array is supported for generated keys

### isGeneratedKeysColumnNameArraySupported

    public boolean isGeneratedKeysColumnNameArraySupported()

  Description copied from interface: `TableMetaDataProvider`
  Does this database support a column name String array for retreiving generated keys `Connection.createStruct(String, Object[])`

  Specified by:
    `isGeneratedKeysColumnNameArraySupported` in interface `TableMetaDataProvider`

### setNativeJdbcExtractor

    public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor)

  Description copied from interface: `TableMetaDataProvider`
  Set the `NativeJdbcExtractor` to use to retrieve the native connection if necessary

  Specified by:
    `setNativeJdbcExtractor` in interface `TableMetaDataProvider`

### getNativeJdbcExtractor

    protected NativeJdbcExtractor getNativeJdbcExtractor()

### initializeWithMetaData

    public void initializeWithMetaData(java.sql.DatabaseMetaData databaseMetaData)
                                throws java.sql.SQLException

  Description copied from interface: `TableMetaDataProvider`
  Initialize using the database metedata provided

  Specified by:
    `initializeWithMetaData` in interface `TableMetaDataProvider`
  Throws:
    `java.sql.SQLException`

### initializeWithTableColumnMetaData

    public void initializeWithTableColumnMetaData(java.sql.DatabaseMetaData databaseMetaData,
                                                  java.lang.String catalogName,
                                                  java.lang.String schemaName,
                                                  java.lang.String tableName)
                                           throws java.sql.SQLException

  Description copied from interface: `TableMetaDataProvider`
  Initialize using provided database metadata, table and column information. This initalization can be turned off by specifying that column meta data should not be used.

  Specified by:
    `initializeWithTableColumnMetaData` in interface `TableMetaDataProvider`
  Parameters:
    `databaseMetaData` - used to retrieve database specific information
    `catalogName` - name of catalog to use or null
    `schemaName` - name of schema name to use or null
    `tableName` - name of the table
  Throws:
    `java.sql.SQLException`

### tableNameToUse

    public java.lang.String tableNameToUse(java.lang.String tableName)

  Description copied from interface: `TableMetaDataProvider`
  Get the table name formatted based on metadata information. This could include altering the case.

  Specified by:
    `tableNameToUse` in interface `TableMetaDataProvider`
  Returns:
    table name formatted

### catalogNameToUse

    public java.lang.String catalogNameToUse(java.lang.String catalogName)

  Description copied from interface: `TableMetaDataProvider`
  Get the catalog name formatted based on metadata information. This could include altering the case.

  Specified by:
    `catalogNameToUse` in interface `TableMetaDataProvider`
  Returns:
    catalog name formatted

### schemaNameToUse

    public java.lang.String schemaNameToUse(java.lang.String schemaName)

  Description copied from interface: `TableMetaDataProvider`
  Get the schema name formatted based on metadata information. This could include altering the case.

  Specified by:
    `schemaNameToUse` in interface `TableMetaDataProvider`
  Returns:
    schema name formatted

### metaDataCatalogNameToUse

    public java.lang.String metaDataCatalogNameToUse(java.lang.String catalogName)

  Description copied from interface: `TableMetaDataProvider`
  Provide any modification of the catalog name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base catalog if mone provided.

  Specified by:
    `metaDataCatalogNameToUse` in interface `TableMetaDataProvider`
  Returns:
    catalog name to use

### metaDataSchemaNameToUse

    public java.lang.String metaDataSchemaNameToUse(java.lang.String schemaName)

  Description copied from interface: `TableMetaDataProvider`
  Provide any modification of the schema name passed in to match the meta data currently used. The reyurned value will be used for meta data lookups. This could include alterig the case used or providing a base schema if mone provided.

  Specified by:
    `metaDataSchemaNameToUse` in interface `TableMetaDataProvider`
  Returns:
    schema name to use

### getDefaultSchema

    protected java.lang.String getDefaultSchema()

  Provide access to default schema for subclasses.

### getDatabaseVersion

    protected java.lang.String getDatabaseVersion()

  Provide access to version info for subclasses.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD