## org.eclipse.datatools.connectivity.sqm.loader
Class JDBCTableConstraintLoader

    java.lang.Object
      org.eclipse.datatools.connectivity.sqm.loader.JDBCBaseLoader
          org.eclipse.datatools.connectivity.sqm.loader.JDBCTableConstraintLoader

Direct Known Subclasses:
  MaxDBTableConstraintLoader, MySqlTableConstraintLoader, SQLiteTableConstraintLoader

    public class JDBCTableConstraintLoader

extends JDBCBaseLoader

Base loader implementation for loading a table's constraint objects (e.g. PK, FK, etc.). This class may be specialized as necessary to meet a particular vendor's needs.

Since:
  1.0

Field Summary
`static java.lang.String` `COLUMN_COLUMN_NAME` The column name containing the column's name.
`static java.lang.String` `COLUMN_DEFERRABILITY` The column name containing the constraint's deferrability.
`static java.lang.String` `COLUMN_DELETE_RULE` The column name containing the constraint's delete rule.
`static java.lang.String` `COLUMN_FK_NAME` The column name containing the foreign key's name.
`static java.lang.String` `COLUMN_FKCOLUMN_NAME` The column name containing the foreign key's name.
`static java.lang.String` `COLUMN_KEY_SEQ` The column name containing the column's key sequence.
`static java.lang.String` `COLUMN_PK_NAME` The column name containing the primary key's name.
`static java.lang.String` `COLUMN_PKCOLUMN_NAME` The column name containing a primary key's column name.
`static java.lang.String` `COLUMN_PKTABLE_CAT` The column name containing the primary key's catalog.
`static java.lang.String` `COLUMN_PKTABLE_NAME` The column name containing the primary key's table.
`static java.lang.String` `COLUMN_PKTABLE_SCHEM` The column name containing the primary key's schema.
`static java.lang.String` `COLUMN_UPDATE_RULE` The column name containing the constraint's update rule.

Constructor Summary
`JDBCTableConstraintLoader(ICatalogObject catalogObject)` This constructs the loader using no filter.
`JDBCTableConstraintLoader(ICatalogObject catalogObject, IConnectionFilterProvider connectionFilterProvider)`

Method Summary
`void` `clearConstraints(org.eclipse.emf.common.util.EList constraintContainer, java.util.List remove)` Removes the specified constraints from the model.
`java.util.Collection` `loadForeignKeys()` Deprecated. see `loadForeignKeys(List, Collection)`
`void` `loadForeignKeys(java.util.List containmentList, java.util.Collection existingFKs)` Loads the "foreign key" objects from the database.
`PrimaryKey` `loadPrimaryKey()` Deprecated. see `loadPrimaryKey(PrimaryKey)`
`PrimaryKey` `loadPrimaryKey(PrimaryKey existingPK)` Loads the "primary key" object from the database.
`java.util.Collection` `loadUniqueConstraints(PrimaryKey pk)` Deprecated. see `loadUniqueConstraints(PrimaryKey, List, Collection)`
`void` `loadUniqueConstraints(PrimaryKey pk, java.util.List containmentList, java.util.Collection existingUCs)` Loads the "unique constraint" objects from the database.

Methods inherited from class org.eclipse.datatools.connectivity.sqm.loader.JDBCBaseLoader
`getCatalogObject, setCatalogObject`

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

Field Detail

### COLUMN_COLUMN_NAME

    public static final java.lang.String COLUMN_COLUMN_NAME

  The column name containing the column's name.

  See Also:
    `java.sql.DatabaseMetaData.getExportedKeys()`, Constant Field Values

### COLUMN_KEY_SEQ

    public static final java.lang.String COLUMN_KEY_SEQ

  The column name containing the column's key sequence.

  See Also:
    `java.sql.DatabaseMetaData.getExportedKeys()`, Constant Field Values

### COLUMN_PK_NAME

    public static final java.lang.String COLUMN_PK_NAME

  The column name containing the primary key's name.

  See Also:
    `java.sql.DatabaseMetaData.getExportedKeys()`, Constant Field Values

### COLUMN_PKCOLUMN_NAME

    public static final java.lang.String COLUMN_PKCOLUMN_NAME

  The column name containing a primary key's column name.

  See Also:
    `java.sql.DatabaseMetaData.getExportedKeys()`, Constant Field Values

### COLUMN_PKTABLE_CAT

    public static final java.lang.String COLUMN_PKTABLE_CAT

  The column name containing the primary key's catalog.

  See Also:
    `java.sql.DatabaseMetaData.getImportedKeys()`, Constant Field Values

### COLUMN_PKTABLE_SCHEM

    public static final java.lang.String COLUMN_PKTABLE_SCHEM

  The column name containing the primary key's schema.

  See Also:
    `java.sql.DatabaseMetaData.getImportedKeys()`, Constant Field Values

### COLUMN_PKTABLE_NAME

    public static final java.lang.String COLUMN_PKTABLE_NAME

  The column name containing the primary key's table.

  See Also:
    `java.sql.DatabaseMetaData.getImportedKeys()`, Constant Field Values

### COLUMN_FKCOLUMN_NAME

    public static final java.lang.String COLUMN_FKCOLUMN_NAME

  The column name containing the foreign key's name.

  See Also:
    `java.sql.DatabaseMetaData.getImportedKeys()`, Constant Field Values

### COLUMN_UPDATE_RULE

    public static final java.lang.String COLUMN_UPDATE_RULE

  The column name containing the constraint's update rule.

  See Also:
    `java.sql.DatabaseMetaData.getImportedKeys()`, Constant Field Values

### COLUMN_DELETE_RULE

    public static final java.lang.String COLUMN_DELETE_RULE

  The column name containing the constraint's delete rule.

  See Also:
    `java.sql.DatabaseMetaData.getImportedKeys()`, Constant Field Values

### COLUMN_FK_NAME

    public static final java.lang.String COLUMN_FK_NAME

  The column name containing the foreign key's name.

  See Also:
    `java.sql.DatabaseMetaData.getImportedKeys()`, Constant Field Values

### COLUMN_DEFERRABILITY

    public static final java.lang.String COLUMN_DEFERRABILITY

  The column name containing the constraint's deferrability.

  See Also:
    `java.sql.DatabaseMetaData.getImportedKeys()`, Constant Field Values

Constructor Detail

### JDBCTableConstraintLoader

    public JDBCTableConstraintLoader(ICatalogObject catalogObject)

  This constructs the loader using no filter.

  Parameters:
    `catalogObject` - the Table object upon which this loader operates.

### JDBCTableConstraintLoader

    public JDBCTableConstraintLoader(ICatalogObject catalogObject,
                                     IConnectionFilterProvider connectionFilterProvider)

Parameters:
  `catalogObject` - the Catalog object upon which this loader operates.
  `connectionFilterProvider` - the filter provider used for filtering the "constraint" objects being loaded

Method Detail

### loadPrimaryKey

    public PrimaryKey loadPrimaryKey()
                              throws java.sql.SQLException

  Deprecated. see `loadPrimaryKey(PrimaryKey)`

  Returns:
    the table's primary key
  Throws:
    `java.sql.SQLException` - if an error occurred during loading.

### loadPrimaryKey

    public PrimaryKey loadPrimaryKey(PrimaryKey existingPK)
                              throws java.sql.SQLException

  Loads the "primary key" object from the database. This method uses the result set from createPrimaryKeyResultSet() to load the "primary key" object from the server..

  Parameters:
    `existingPK` - the existing primary key, if one exists.
  Returns:
    the table's primary key
  Throws:
    `java.sql.SQLException` - if an error occurred during loading.

### loadUniqueConstraints

    public java.util.Collection loadUniqueConstraints(PrimaryKey pk)
                                               throws java.sql.SQLException

  Deprecated. see `loadUniqueConstraints(PrimaryKey, List, Collection)`

  Parameters:
    `pk` - the table's primary key. Used to prevent duplicating the PK constraint.
  Returns:
    a collection of UniqueConstraint objects
  Throws:
    `java.sql.SQLException` - if an error occurred during loading.

### loadUniqueConstraints

    public void loadUniqueConstraints(PrimaryKey pk,
                                      java.util.List containmentList,
                                      java.util.Collection existingUCs)
                               throws java.sql.SQLException

  Loads the "unique constraint" objects from the database. This method uses the result set from createUniqueConstraintResultSet() to load the "unique constraint" objects from the server.

  Parameters:
    `pk` - the table's primary key. Used to prevent duplicating the PK constraint.
    `containmentList` - the containment list held by parent
    `existingUCs` - the catalog objects which were previously loaded
  Throws:
    `java.sql.SQLException` - if an error occurred during loading.

### loadForeignKeys

    public java.util.Collection loadForeignKeys()
                                         throws java.sql.SQLException

  Deprecated. see `loadForeignKeys(List, Collection)`

  Returns:
    a collection of ForeignKey objects
  Throws:
    `java.sql.SQLException` - if an error occurred during loading.

### loadForeignKeys

    public void loadForeignKeys(java.util.List containmentList,
                                java.util.Collection existingFKs)
                         throws java.sql.SQLException

  Loads the "foreign key" objects from the database. This method uses the result set from createUniqueConstraintResultSet() to load the "foreign key" objects from the server.

  Parameters:
    `containmentList` - the containment list held by parent
    `existingFKs` - the catalog objects which were previously loaded
  Throws:
    `java.sql.SQLException` - if an error occurred during loading.

### clearConstraints

    public void clearConstraints(org.eclipse.emf.common.util.EList constraintContainer,
                                 java.util.List remove)

  Removes the specified constraints from the model.

  Parameters:
    `constraintContainer` - the constraints container
    `remove` - the constraints to remove.