Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.ddlutils.alteration
Class ModelComparator

    java.lang.Object
      org.apache.ddlutils.alteration.ModelComparator

    public class ModelComparator

extends Object

Compares two database models and creates change objects that express how to adapt the first model so that it becomes the second one. Neither of the models are changed in the process, however, it is also assumed that the models do not change in between. TODO: Add support and tests for the change of the column order

Version:
  $Revision: $

Constructor Summary
`ModelComparator(PlatformInfo platformInfo, boolean caseSensitive)` Creates a new model comparator object.

Method Summary
`List` | `compare(Database sourceModel, Database targetModel)` Compares the two models and returns the changes necessary to create the second model from the first one.
`List` | `compareColumns(Table sourceTable, Column sourceColumn, Table targetTable, Column targetColumn)` Compares the two columns and returns the changes necessary to create the second column from the first one.
`List` | `compareTables(Database sourceModel, Table sourceTable, Database targetModel, Table targetTable)` Compares the two tables and returns the changes necessary to create the second table from the first one.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ModelComparator

    public ModelComparator(PlatformInfo platformInfo,
                           boolean caseSensitive)

  Creates a new model comparator object.

  Parameters:
    `platformInfo` - The platform info
    `caseSensitive` - Whether comparison is case sensitive

Method Detail

### compare

    public List compare(Database sourceModel,
                        Database targetModel)

  Compares the two models and returns the changes necessary to create the second model from the first one.

  Parameters:
    `sourceModel` - The source model
    `targetModel` - The target model
  Returns:
    The changes

### compareTables

    public List compareTables(Database sourceModel,
                              Table sourceTable,
                              Database targetModel,
                              Table targetTable)

  Compares the two tables and returns the changes necessary to create the second table from the first one.

  Parameters:
    `sourceModel` - The source model which contains the source table
    `sourceTable` - The source table
    `targetModel` - The target model which contains the target table
    `targetTable` - The target table
  Returns:
    The changes

### compareColumns

    public List compareColumns(Table sourceTable,
                               Column sourceColumn,
                               Table targetTable,
                               Column targetColumn)

  Compares the two columns and returns the changes necessary to create the second column from the first one.

  Parameters:
    `sourceTable` - The source table which contains the source column
    `sourceColumn` - The source column
    `targetTable` - The target table which contains the target column
    `targetColumn` - The target column
  Returns:
    The changes

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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