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
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:
-
Field Summary
Fields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).intReturns whether checking of this foreign key can be deferred, as aDatabaseMetaDatacode such asimportedKeyInitiallyDeferred.intReturns what happens to the foreign key when the referenced primary key is deleted, as aDatabaseMetaDatacode such asimportedKeyCascade.Returns the name of the foreign key constraint, or null if the database does not report one.intReturns this column's 1-based position within the foreign key.Returns the name of the referenced primary key constraint, or null if the database does not report one.Returns the referencing (foreign key) table's name, prefixed with its schema and a dot when it has one.Returns the referenced (primary key) table's name, prefixed with its schema and a dot when it has one.getTable()Returns the table this key was added to, or null.intReturns what happens to the foreign key when the referenced primary key is updated, as aDatabaseMetaDatacode such asimportedKeyCascade.booleanisForiegnKeyTable(JdbcTable table) Returnstrueif the given table is the referencing (foreign key) table, comparing catalog, schema and name exactly.booleanisPrimaryKeyTable(JdbcTable table) Returnstrueif the given table is the referenced (primary key) table, comparing catalog, schema and name exactly.setDeferrability(int deferrability) Sets whether checking of this foreign key can be deferred, as aDatabaseMetaDatacode such asimportedKeyInitiallyDeferred.setDeleteRule(int deleteRule) Sets what happens to the foreign key when the referenced primary key is deleted, as aDatabaseMetaDatacode such asimportedKeyCascade.setForiegnKeyCatalogName(String foriegnKeyCatalogName) setForiegnKeyColumnName(String foriegnKeyColumnName) setForiegnKeyName(String foriegnKeyName) Sets the name of the foreign key constraint.setForiegnKeySchemaName(String foriegnKeySchemaName) setForiegnKeyTableName(String foriegnKeyTableName) setKeySequence(int keySequence) Sets this column's 1-based position within the foreign key.setPrimaryKeyCatalogName(String primaryKeyCatalogName) setPrimaryKeyColumnName(String primaryKeyColumnName) setPrimaryKeyName(String primaryKeyName) Sets the name of the referenced primary key constraint.setPrimaryKeySchemaName(String primaryKeySchemaName) setPrimaryKeyTableName(String primaryKeyTableName) protected JdbcImportedKeySets the table this key belongs to; called when the key is added to aJdbcTable.setUpdateRule(int updateRule) Sets what happens to the foreign key when the referenced primary key is updated, as aDatabaseMetaDatacode such asimportedKeyCascade.toRecord()Converts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.Methods inherited from class com.northconcepts.datapipeline.foundations.core.Bean
addExceptionProperties, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionProperties, exception, exception, exceptionMethods inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
fromJson, fromJson, toJson, toJson, toJsonMethods inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
fromXml, fromXml, fromXmlElement, toXml, toXml, toXml, toXml, toXml, toXmlElement
-
Constructor Details
-
JdbcImportedKey
public JdbcImportedKey()
-
-
Method Details
-
getTable
Returns the table this key was added to, or null. -
setTable
Sets the table this key belongs to; called when the key is added to aJdbcTable. -
getQualifiedPrimaryKeyTable
Returns the referenced (primary key) table's name, prefixed with its schema and a dot when it has one. -
getQualifiedForiegnKeyTable
Returns the referencing (foreign key) table's name, prefixed with its schema and a dot when it has one. -
getPrimaryKeyCatalogName
-
setPrimaryKeyCatalogName
-
getPrimaryKeySchemaName
-
setPrimaryKeySchemaName
-
getPrimaryKeyTableName
-
setPrimaryKeyTableName
-
getPrimaryKeyColumnName
-
setPrimaryKeyColumnName
-
getForiegnKeyCatalogName
-
setForiegnKeyCatalogName
-
getForiegnKeySchemaName
-
setForiegnKeySchemaName
-
getForiegnKeyTableName
-
setForiegnKeyTableName
-
getForiegnKeyColumnName
-
setForiegnKeyColumnName
-
getKeySequence
public int getKeySequence()Returns this column's 1-based position within the foreign key. -
setKeySequence
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 aDatabaseMetaDatacode such asimportedKeyCascade. -
setUpdateRule
Sets what happens to the foreign key when the referenced primary key is updated, as aDatabaseMetaDatacode such asimportedKeyCascade. -
getDeleteRule
public int getDeleteRule()Returns what happens to the foreign key when the referenced primary key is deleted, as aDatabaseMetaDatacode such asimportedKeyCascade. -
setDeleteRule
Sets what happens to the foreign key when the referenced primary key is deleted, as aDatabaseMetaDatacode such asimportedKeyCascade. -
getForiegnKeyName
Returns the name of the foreign key constraint, or null if the database does not report one. -
setForiegnKeyName
Sets the name of the foreign key constraint. -
getPrimaryKeyName
Returns the name of the referenced primary key constraint, or null if the database does not report one. -
setPrimaryKeyName
Sets the name of the referenced primary key constraint. -
getDeferrability
public int getDeferrability()Returns whether checking of this foreign key can be deferred, as aDatabaseMetaDatacode such asimportedKeyInitiallyDeferred. -
setDeferrability
Sets whether checking of this foreign key can be deferred, as aDatabaseMetaDatacode such asimportedKeyInitiallyDeferred. -
isPrimaryKeyTable
Returnstrueif the given table is the referenced (primary key) table, comparing catalog, schema and name exactly. -
isForiegnKeyTable
Returnstrueif the given table is the referencing (foreign key) table, comparing catalog, schema and name exactly. -
toRecord
Description copied from interface:RecordSerializableConverts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.- Specified by:
toRecordin interfaceRecordSerializable- Overrides:
toRecordin classBean
-
fromRecord
Description copied from interface:RecordSerializableLoads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Specified by:
fromRecordin interfaceRecordSerializable- Overrides:
fromRecordin classBean- Parameters:
source-- Returns:
- this instance.
-