java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.platform.JdbcModelReader
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.platform.interbase.InterbaseModelReader

public class InterbaseModelReader extends JdbcModelReader
The Jdbc Model Reader for Interbase.
Version:
$Revision: $
  • Constructor Details

    • InterbaseModelReader

      public InterbaseModelReader(Platform platform)
      Creates a new model reader for Interbase databases.
      Parameters:
      platform - The platform that this model reader belongs to
  • Method Details

    • 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