2.3.8 The ForeignKey Class ForeignKey() ForeignKey::FkAction ForeignKey::getName() ForeignKey::getParentTable() ForeignKey::getChildTable() ForeignKey::getParentColumnCount() ForeignKey::getChildColumnCount() ForeignKey::getParentIndex() ForeignKey::getChildIndex() ForeignKey::getParentColumnNo() ForeignKey::getChildColumnNo() ForeignKey::getOnUpdateAction() ForeignKey::getOnDeleteAction() ForeignKey::setName() ForeignKey::setParent() ForeignKey::setChild() ForeignKey::setOnUpdateAction() ForeignKey::setOnDeleteAction() ForeignKey::getObjectStatus() ForeignKey::getObjectId() ForeignKey::getObjectVersion()


This class represents a foreign key on an NDB table. It was added to the NDB API in NDB Cluster 7.3.

Parent class.  Object

Child classes.  None.

Methods.  The following table lists the public methods of the ForeignKey class and the purpose or use of each method:

MethodPurpose / Use
ForeignKey()Class constructor
~ForeignKey()Class destructor
getName()Get the foreign key's name
getParentTable()Get the foreign key's parent table
getChildTable()Get the foreign key's child table
getParentColumnCount()Get the number of columns in the parent table
getChildColumnCount()Get the number of columns in the child table
getParentColumnNo()Get the column number in the parent table
getChildColumnNo()Get the column number in the child table
getParentIndex()Returns 0 if key points to parent table's primary key
getChildIndex()Returns 0 if child references resolved using child table's primary key
getOnUpdateAction()Get the foreign's key update action (FkAction)
getOnDeleteAction()Get the foreign key's delete action (FkAction)
setName()Set the foreign key's name
setParent()Set the foreign key's parent table
setChild()Set a foreign key's child table
setOnUpdateAction()Set the foreign's key update action (FkAction)
setOnDeleteAction()Set the foreign key's delete action (FkAction)
getObjectStatus()Get the object status
getObjectId()Get the object ID
getObjectVersion()Get the object version

Types.  The ForeignKey class has one public type, the FkAction type.

This diagram shows all public members of the ForeignKey class:

Figure 2.6 NdbDictionary::Object::ForeignKey

Public members of the ForeignKey class.