Class JdbcImportedKey

java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.jdbc.JdbcImportedKey
All Implemented Interfaces:
DataExceptionContributor, JsonSerializable, RecordSerializable, XmlSerializable, Serializable
Direct Known Subclasses:
JdbcExportedKey

public class JdbcImportedKey extends Bean
One column of a foreign key: the referencing (foreign key) column and the primary key column it points to, as reported by JDBC getImportedKeys; a multi-column key has one entry per column.
See Also:
  • Constructor Details

    • JdbcImportedKey

      public JdbcImportedKey()
  • Method Details

    • getTable

      public JdbcTable getTable()
      Returns the table this key was added to, or null.
    • setTable

      protected JdbcImportedKey setTable(JdbcTable table)
      Sets the table this key belongs to; called when the key is added to a JdbcTable.
    • getQualifiedPrimaryKeyTable

      public String getQualifiedPrimaryKeyTable()
      Returns the referenced (primary key) table's name, prefixed with its schema and a dot when it has one.
    • getQualifiedForiegnKeyTable

      public String getQualifiedForiegnKeyTable()
      Returns the referencing (foreign key) table's name, prefixed with its schema and a dot when it has one.
    • getPrimaryKeyCatalogName

      public String getPrimaryKeyCatalogName()
    • setPrimaryKeyCatalogName

      public JdbcImportedKey setPrimaryKeyCatalogName(String primaryKeyCatalogName)
    • getPrimaryKeySchemaName

      public String getPrimaryKeySchemaName()
    • setPrimaryKeySchemaName

      public JdbcImportedKey setPrimaryKeySchemaName(String primaryKeySchemaName)
    • getPrimaryKeyTableName

      public String getPrimaryKeyTableName()
    • setPrimaryKeyTableName

      public JdbcImportedKey setPrimaryKeyTableName(String primaryKeyTableName)
    • getPrimaryKeyColumnName

      public String getPrimaryKeyColumnName()
    • setPrimaryKeyColumnName

      public JdbcImportedKey setPrimaryKeyColumnName(String primaryKeyColumnName)
    • getForiegnKeyCatalogName

      public String getForiegnKeyCatalogName()
    • setForiegnKeyCatalogName

      public JdbcImportedKey setForiegnKeyCatalogName(String foriegnKeyCatalogName)
    • getForiegnKeySchemaName

      public String getForiegnKeySchemaName()
    • setForiegnKeySchemaName

      public JdbcImportedKey setForiegnKeySchemaName(String foriegnKeySchemaName)
    • getForiegnKeyTableName

      public String getForiegnKeyTableName()
    • setForiegnKeyTableName

      public JdbcImportedKey setForiegnKeyTableName(String foriegnKeyTableName)
    • getForiegnKeyColumnName

      public String getForiegnKeyColumnName()
    • setForiegnKeyColumnName

      public JdbcImportedKey setForiegnKeyColumnName(String foriegnKeyColumnName)
    • getKeySequence

      public int getKeySequence()
      Returns this column's 1-based position within the foreign key.
    • setKeySequence

      public JdbcImportedKey setKeySequence(int keySequence)
      Sets this column's 1-based position within the foreign key.
    • getUpdateRule

      public int getUpdateRule()
      Returns what happens to the foreign key when the referenced primary key is updated, as a DatabaseMetaData code such as importedKeyCascade.
    • setUpdateRule

      public JdbcImportedKey setUpdateRule(int updateRule)
      Sets what happens to the foreign key when the referenced primary key is updated, as a DatabaseMetaData code such as importedKeyCascade.
    • getDeleteRule

      public int getDeleteRule()
      Returns what happens to the foreign key when the referenced primary key is deleted, as a DatabaseMetaData code such as importedKeyCascade.
    • setDeleteRule

      public JdbcImportedKey setDeleteRule(int deleteRule)
      Sets what happens to the foreign key when the referenced primary key is deleted, as a DatabaseMetaData code such as importedKeyCascade.
    • getForiegnKeyName

      public String getForiegnKeyName()
      Returns the name of the foreign key constraint, or null if the database does not report one.
    • setForiegnKeyName

      public JdbcImportedKey setForiegnKeyName(String foriegnKeyName)
      Sets the name of the foreign key constraint.
    • getPrimaryKeyName

      public String getPrimaryKeyName()
      Returns the name of the referenced primary key constraint, or null if the database does not report one.
    • setPrimaryKeyName

      public JdbcImportedKey setPrimaryKeyName(String primaryKeyName)
      Sets the name of the referenced primary key constraint.
    • getDeferrability

      public int getDeferrability()
      Returns whether checking of this foreign key can be deferred, as a DatabaseMetaData code such as importedKeyInitiallyDeferred.
    • setDeferrability

      public JdbcImportedKey setDeferrability(int deferrability)
      Sets whether checking of this foreign key can be deferred, as a DatabaseMetaData code such as importedKeyInitiallyDeferred.
    • isPrimaryKeyTable

      public boolean isPrimaryKeyTable(JdbcTable table)
      Returns true if the given table is the referenced (primary key) table, comparing catalog, schema and name exactly.
    • isForiegnKeyTable

      public boolean isForiegnKeyTable(JdbcTable table)
      Returns true if the given table is the referencing (foreign key) table, comparing catalog, schema and name exactly.
    • toRecord

      public Record toRecord()
      Description copied from interface: RecordSerializable
      Converts this object's state to a record that RecordSerializable.fromRecord(Record) can load.
      Specified by:
      toRecord in interface RecordSerializable
      Overrides:
      toRecord in class Bean
    • fromRecord

      public JdbcImportedKey fromRecord(Record source)
      Description copied from interface: RecordSerializable
      Loads this instance's state from a record and returns this (for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.
      Specified by:
      fromRecord in interface RecordSerializable
      Overrides:
      fromRecord in class Bean
      Parameters:
      source -
      Returns:
      this instance.