Class FirebirdModelReader
java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.platform.JdbcModelReader
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.platform.firebird.FirebirdModelReader
The Jdbc Model Reader for Firebird.
- Version:
- $Revision: $
-
Constructor Summary
ConstructorDescriptionFirebirdModelReader
(Platform platform) Creates a new model reader for Firebird databases. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Helper method that determines the auto increment status using Firebird's system tables.determineSchemaOf
(Connection connection, String schemaPattern, Table table) Tries to find the schema to which the given table belongs.protected boolean
isInternalForeignKeyIndex
(DatabaseMetaDataWrapper metaData, Table table, ForeignKey fk, Index index) Tries to determine whether the index is the internal database-generated index for the given foreign key.protected boolean
isInternalPrimaryKeyIndex
(DatabaseMetaDataWrapper metaData, Table table, Index index) Tries to determine whether the index is the internal database-generated index for the given table's primary key.protected Column
readColumn
(DatabaseMetaDataWrapper metaData, Map values) Extracts a column definition from the result set.protected Collection
readColumns
(DatabaseMetaDataWrapper metaData, String tableName) Reads the column definitions for the indicated table.protected Collection
readForeignKeys
(DatabaseMetaDataWrapper metaData, String tableName) Retrieves the foreign keys of the indicated table.protected Collection
readIndices
(DatabaseMetaDataWrapper metaData, String tableName) Determines the indices for the indicated table.protected Collection
readPrimaryKeyNames
(DatabaseMetaDataWrapper metaData, String tableName) Retrieves the names of the columns that make up the primary key for a given table.protected Table
readTable
(DatabaseMetaDataWrapper metaData, Map values) Reads the next table from the meta data.Methods inherited from class edu.internet2.middleware.grouper.ext.org.apache.ddlutils.platform.JdbcModelReader
determineAutoIncrementFromResultSetMetaData, getColumnsForColumn, getColumnsForFK, getColumnsForIndex, getColumnsForPK, getColumnsForTable, getConnection, getDatabase, getDatabase, getDefaultCatalogPattern, getDefaultColumnPattern, getDefaultSchemaPattern, getDefaultTablePattern, getDefaultTableTypes, getPlatform, getPlatformInfo, initColumnsForColumn, initColumnsForFK, initColumnsForIndex, initColumnsForPK, initColumnsForTable, matches, readColumns, readForeignKey, readIndex, readPrimaryKeyName, readTables, removeInternalForeignKeyIndex, removeInternalPrimaryKeyIndex, removeSystemIndices, setDefaultCatalogPattern, setDefaultColumnPattern, setDefaultSchemaPattern, setDefaultTablePattern, setDefaultTableTypes, sortForeignKeys, unescape
-
Constructor Details
-
FirebirdModelReader
Creates a new model reader for Firebird databases.- Parameters:
platform
- The platform that this model reader belongs to
-
-
Method Details
-
readTable
Reads the next table from the meta data.- Overrides:
readTable
in classJdbcModelReader
- Parameters:
metaData
- The database meta datavalues
- The table metadata values as defined byJdbcModelReader.getColumnsForTable()
- Returns:
- The table or
null
if the result set row did not contain a valid table - Throws:
SQLException
-
readColumns
protected Collection readColumns(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException Reads the column definitions for the indicated table.- Overrides:
readColumns
in classJdbcModelReader
- Parameters:
metaData
- The database meta datatableName
- The name of the table- Returns:
- The columns
- Throws:
SQLException
-
readColumn
Extracts a column definition from the result set.- Overrides:
readColumn
in classJdbcModelReader
- Parameters:
metaData
- The database meta datavalues
- The column meta data values as defined byJdbcModelReader.getColumnsForColumn()
- Returns:
- The column
- Throws:
SQLException
-
determineAutoIncrementColumns
Helper method that determines the auto increment status using Firebird's system tables.- Parameters:
table
- The table- Throws:
SQLException
-
readPrimaryKeyNames
protected Collection readPrimaryKeyNames(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException Retrieves the names of the columns that make up the primary key for a given table.- Overrides:
readPrimaryKeyNames
in classJdbcModelReader
- Parameters:
metaData
- The database meta datatableName
- The name of the table from which to retrieve PK information- Returns:
- The primary key column names
- Throws:
SQLException
-
readForeignKeys
protected Collection readForeignKeys(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException Retrieves the foreign keys of the indicated table.- Overrides:
readForeignKeys
in classJdbcModelReader
- Parameters:
metaData
- The database meta datatableName
- The name of the table from which to retrieve FK information- Returns:
- The foreign keys
- Throws:
SQLException
-
readIndices
protected Collection readIndices(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException Determines the indices for the indicated table.- Overrides:
readIndices
in classJdbcModelReader
- Parameters:
metaData
- The database meta datatableName
- The name of the table- Returns:
- The list of indices
- Throws:
SQLException
-
isInternalPrimaryKeyIndex
protected boolean isInternalPrimaryKeyIndex(DatabaseMetaDataWrapper metaData, Table table, Index index) throws SQLException Tries to determine whether the index is the internal database-generated index for the given table's primary key. Note that only unique indices with the correct columns are fed to this method. Redefine this method for specific platforms if there are better ways to determine internal indices.- Overrides:
isInternalPrimaryKeyIndex
in classJdbcModelReader
- Parameters:
metaData
- The database meta datatable
- The table owning the indexindex
- The index to check- Returns:
true
if the index seems to be an internal primary key one- Throws:
SQLException
-
isInternalForeignKeyIndex
protected boolean isInternalForeignKeyIndex(DatabaseMetaDataWrapper metaData, Table table, ForeignKey fk, Index index) throws SQLException Tries to determine whether the index is the internal database-generated index for the given foreign key. Note that only non-unique indices with the correct columns are fed to this method. Redefine this method for specific platforms if there are better ways to determine internal indices.- Overrides:
isInternalForeignKeyIndex
in classJdbcModelReader
- Parameters:
metaData
- The database meta datatable
- The table owning the index and foreign keyfk
- The foreign keyindex
- The index to check- Returns:
true
if the index seems to be an internal primary key one- Throws:
SQLException
-
determineSchemaOf
public String determineSchemaOf(Connection connection, String schemaPattern, Table table) throws SQLException Tries to find the schema to which the given table belongs.- Overrides:
determineSchemaOf
in classJdbcModelReader
- Parameters:
connection
- The database connectionschemaPattern
- The schema pattern to limit the schemas to search intable
- The table to search for- Returns:
- The schema name or
null
if the schema of the table could not be found - Throws:
SQLException
-