org.apache.ddlutils.platform.sybase
Class SybaseModelReader

java.lang.Object
  extended by org.apache.ddlutils.platform.JdbcModelReader
      extended by org.apache.ddlutils.platform.sybase.SybaseModelReader

public class SybaseModelReader
extends JdbcModelReader

Reads a database model from a Sybase database.

Version:
$Revision: $

Constructor Summary
SybaseModelReader(Platform platform)
          Creates a new model reader for Sybase databases.
 
Method Summary
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 readForeignKeys(DatabaseMetaDataWrapper metaData, String tableName)
          Retrieves the foreign keys of the indicated table.
protected  void readIndex(DatabaseMetaDataWrapper metaData, Map values, Map knownIndices)
          Reads the next index spec from the result set.
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, determineSchemaOf, getColumnsForColumn, getColumnsForFK, getColumnsForIndex, getColumnsForPK, getColumnsForTable, getConnection, getDatabase, getDatabase, getDefaultCatalogPattern, getDefaultColumnPattern, getDefaultSchemaPattern, getDefaultTablePattern, getDefaultTableTypes, getPlatform, getPlatformInfo, initColumnsForColumn, initColumnsForFK, initColumnsForIndex, initColumnsForPK, initColumnsForTable, isInternalForeignKeyIndex, matches, readColumns, readColumns, readForeignKey, readIndices, readPrimaryKeyName, readPrimaryKeyNames, 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

SybaseModelReader

public SybaseModelReader(Platform platform)
Creates a new model reader for Sybase 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

readColumn

protected Column readColumn(DatabaseMetaDataWrapper metaData,
                            Map values)
                     throws SQLException
Extracts a column definition from the result set.

Overrides:
readColumn in class JdbcModelReader
Parameters:
metaData - The database meta data
values - The column meta data values as defined by JdbcModelReader.getColumnsForColumn()
Returns:
The column
Throws:
SQLException

readIndex

protected void readIndex(DatabaseMetaDataWrapper metaData,
                         Map values,
                         Map knownIndices)
                  throws SQLException
Reads the next index spec from the result set.

Overrides:
readIndex in class JdbcModelReader
Parameters:
metaData - The database meta data
values - The index meta data as defined by JdbcModelReader.getColumnsForIndex()
knownIndices - The already read indices for the current table
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


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