org.apache.ddlutils.platform.interbase
Class InterbaseModelReader

java.lang.Object
  extended by org.apache.ddlutils.platform.JdbcModelReader
      extended by org.apache.ddlutils.platform.interbase.InterbaseModelReader

public class InterbaseModelReader
extends JdbcModelReader

The Jdbc Model Reader for Interbase.

Version:
$Revision: $

Constructor Summary
InterbaseModelReader(Platform platform)
          Creates a new model reader for Interbase databases.
 
Method Summary
protected  void adjustColumns(Table table)
          Adjusts the columns in the table by fixing types and default values.
protected  void determineAutoIncrementColumns(Table table)
          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.
 String 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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterbaseModelReader

public InterbaseModelReader(Platform platform)
Creates a new model reader for Interbase databases.

Parameters:
platform - The platform that this model reader belongs to
Method Detail

readTable

protected Table readTable(DatabaseMetaDataWrapper metaData,
                          Map values)
                   throws SQLException
Reads the next table from the meta data.

Overrides:
readTable in class JdbcModelReader
Parameters:
metaData - The database meta data
values - The table metadata values as defined by JdbcModelReader.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 class JdbcModelReader
Parameters:
metaData - The database meta data
tableName - The name of the table
Returns:
The columns
Throws:
SQLException

determineExtraColumnInfo

protected void determineExtraColumnInfo(Table table)
                                 throws SQLException
Helper method that determines extra column info from the system tables: default value, precision, scale.

Parameters:
table - The table
Throws:
SQLException

determineAutoIncrementColumns

protected void determineAutoIncrementColumns(Table table)
                                      throws SQLException
Helper method that determines the auto increment status using Interbase's system tables.

Parameters:
table - The table
Throws:
SQLException

adjustColumns

protected void adjustColumns(Table table)
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 class JdbcModelReader
Parameters:
metaData - The database meta data
tableName - 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 class JdbcModelReader
Parameters:
metaData - The database meta data
tableName - 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 class JdbcModelReader
Parameters:
metaData - The database meta data
table - The table owning the index
index - 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 class JdbcModelReader
Parameters:
metaData - The database meta data
table - The table owning the index and foreign key
fk - The foreign key
index - 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 class JdbcModelReader
Parameters:
connection - The database connection
schemaPattern - The schema pattern to limit the schemas to search in
table - The table to search for
Returns:
The schema name or null if the schema of the table could not be found
Throws:
SQLException


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.