Class InterbaseModelReader
java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.platform.JdbcModelReader
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.platform.interbase.InterbaseModelReader
The Jdbc Model Reader for Interbase.
- Version:
- $Revision: $
-
Constructor Summary
ConstructorDescriptionInterbaseModelReader
(Platform platform) Creates a new model reader for Interbase databases. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
adjustColumns
(Table table) Adjusts the columns in the table by fixing types and default values.protected void
Helper method that determines the auto increment status using Interbase's system tables.protected void
determineExtraColumnInfo
(Table table) Helper method that determines extra column info from the system tables: default value, precision, scale.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 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
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, readColumn, readColumns, readForeignKey, readIndex, readIndices, readPrimaryKeyName, readTables, removeInternalForeignKeyIndex, removeInternalPrimaryKeyIndex, removeSystemIndices, setDefaultCatalogPattern, setDefaultColumnPattern, setDefaultSchemaPattern, setDefaultTablePattern, setDefaultTableTypes, sortForeignKeys, unescape
-
Constructor Details
-
InterbaseModelReader
Creates a new model reader for Interbase 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
-
determineExtraColumnInfo
Helper method that determines extra column info from the system tables: default value, precision, scale.- Parameters:
table
- The table- Throws:
SQLException
-
determineAutoIncrementColumns
Helper method that determines the auto increment status using Interbase's system tables.- Parameters:
table
- The table- Throws:
SQLException
-
adjustColumns
Adjusts the columns in the table by fixing types and default values.- Parameters:
table
- The table
-
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
-
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
-