It models a foreign key constraint for a DataSetType. More...
#include <ForeignKey.h>
Public Member Functions | |
void | add (te::dt::Property *p) |
It adds a property to the foreign key constraint. More... | |
void | addRefProperty (te::dt::Property *p) |
It adds a reference property (on the referenced DataSetType) of this foreign key constraint. More... | |
Constraint * | clone () |
It returns a clone of the object. More... | |
ForeignKey (unsigned int id=0) | |
Constructor. More... | |
ForeignKey (const std::string &name, unsigned int id=0) | |
Constructor. More... | |
ForeignKey (const ForeignKey &rhs) | |
Copy constructor not allowed. More... | |
virtual DataSetType * | getDataSetType () const |
It returns the DataSetType associated to the constraint. More... | |
virtual unsigned int | getId () const |
It returns the constraint identifier. More... | |
virtual const std::string & | getName () const |
It returns the constraint name. More... | |
FKActionType | getOnDeleteAction () const |
It returns the action performed when a referenced element value in the referenced DataSetType is being deleted. More... | |
FKActionType | getOnUpdateAction () const |
It returns the action performed when a referenced element value in the referenced DataSetType is being updated to a new value. More... | |
const std::vector< te::dt::Property * > & | getProperties () const |
It returns the properties that take part of the foreign key constraint. More... | |
DataSetType * | getReferencedDataSetType () const |
It returns the referenced DataSetType of this foreign key constraint. More... | |
const std::vector< te::dt::Property * > & | getReferencedProperties () const |
It returns the referenced properties (on the referenced DataSetType) of this foreign key constraint. More... | |
ConstraintType | getType () const |
It returns the constraint type: FOREIGNKEY. More... | |
bool | has (te::dt::Property *p) |
It verifies if Property takes part of the foreign key. More... | |
bool | isReferenced (te::dt::Property *p) |
It verifies if Property is referenced by the foreign key. More... | |
ForeignKey & | operator= (const ForeignKey &rhs) |
Assignment operator. More... | |
void | replace (te::dt::Property *p, te::dt::Property *pp) |
It changes a reference to property p to pp. More... | |
virtual void | setDataSetType (DataSetType *dt) |
It sets the DataSetType associated to the constraint. More... | |
virtual void | setId (unsigned int id) |
It sets the constraint identifier. More... | |
virtual void | setName (const std::string &name) |
It sets the constraint name. More... | |
void | setOnDeleteAction (FKActionType a) |
It sets the action to be performed when a referenced element value in the referenced DataSetType is being deleted. More... | |
void | setOnUpdateAction (FKActionType a) |
It sets the action to be performed when a referenced element value in the referenced DataSetType is being updated to a new value. More... | |
void | setProperties (const std::vector< te::dt::Property * > &properties) |
It sets the properties that take part of the foreign key constraint. More... | |
void | setReferencedDataSetType (DataSetType *refDt) |
It sets the referenced DataSetType of this foreign key constraint. More... | |
void | setReferencedProperties (const std::vector< te::dt::Property * > &properties) |
It sets the referenced properties (on the referenced DataSetType) of this foreign key constraint. More... | |
~ForeignKey () | |
Destructor. More... | |
Private Attributes | |
FKActionType | m_onDelete |
The action to be performed when a referenced element value in the referenced DataSetType is being deleted. More... | |
FKActionType | m_onUpdate |
The action to be performed when a referenced element value in the referenced DataSetType is being updated to a new value. More... | |
std::vector< te::dt::Property * > | m_properties |
The properties that are part of the foreign key constraint. More... | |
DataSetType * | m_refDt |
The referenced DataSetType of this foreign key constraint. More... | |
std::vector< te::dt::Property * > | m_refProperties |
The referenced properties (on the referenced DataSetType) of this foreign key constraint. More... | |
It models a foreign key constraint for a DataSetType.
Definition at line 50 of file ForeignKey.h.
te::da::ForeignKey::ForeignKey | ( | unsigned int | id = 0 | ) |
Constructor.
The default fk will have the actions OnDelete and OnUpdate set as NO_ACTION.
id | The fk identifier. |
te::da::ForeignKey::ForeignKey | ( | const std::string & | name, |
unsigned int | id = 0 |
||
) |
Constructor.
name | The foreign key constraint name. |
id | The fk identifier. |
te::da::ForeignKey::ForeignKey | ( | const ForeignKey & | rhs | ) |
Copy constructor not allowed.
The new object will not have an associated DataSetType.
rhs | Right-hand-side instance. |
|
inline |
Destructor.
Definition at line 85 of file ForeignKey.h.
|
inline |
It adds a property to the foreign key constraint.
p | The property to be added to the foreign key constraint. |
Definition at line 112 of file ForeignKey.h.
|
inline |
It adds a reference property (on the referenced DataSetType) of this foreign key constraint.
p | The referenced property (on the referenced DataSetType) of this foreign key constraint. |
Definition at line 137 of file ForeignKey.h.
|
virtual |
It returns a clone of the object.
The new object will not have an associated DataSetType.
Implements te::da::Constraint.
|
inlinevirtualinherited |
It returns the DataSetType associated to the constraint.
Definition at line 133 of file Constraint.h.
|
inlinevirtualinherited |
It returns the constraint identifier.
Definition at line 103 of file Constraint.h.
|
inlinevirtualinherited |
It returns the constraint name.
Definition at line 119 of file Constraint.h.
|
inline |
It returns the action performed when a referenced element value in the referenced DataSetType is being deleted.
Definition at line 167 of file ForeignKey.h.
|
inline |
It returns the action performed when a referenced element value in the referenced DataSetType is being updated to a new value.
Definition at line 181 of file ForeignKey.h.
|
inline |
It returns the properties that take part of the foreign key constraint.
Definition at line 103 of file ForeignKey.h.
|
inline |
It returns the referenced DataSetType of this foreign key constraint.
Definition at line 153 of file ForeignKey.h.
|
inline |
It returns the referenced properties (on the referenced DataSetType) of this foreign key constraint.
Definition at line 128 of file ForeignKey.h.
|
inlinevirtual |
It returns the constraint type: FOREIGNKEY.
Implements te::da::Constraint.
Definition at line 225 of file ForeignKey.h.
References te::da::FOREIGN_KEY.
bool te::da::ForeignKey::has | ( | te::dt::Property * | p | ) |
It verifies if Property takes part of the foreign key.
p | The Property to be verified. |
bool te::da::ForeignKey::isReferenced | ( | te::dt::Property * | p | ) |
It verifies if Property is referenced by the foreign key.
p | The Property to be verified. |
ForeignKey& te::da::ForeignKey::operator= | ( | const ForeignKey & | rhs | ) |
Assignment operator.
The new object will not have an assigned DataSetType.
rhs | Right-hand-side instance. |
void te::da::ForeignKey::replace | ( | te::dt::Property * | p, |
te::dt::Property * | pp | ||
) |
It changes a reference to property p to pp.
p | A property that takes part of the foreign key or is referenced by it. |
pp | The property that will take p place. |
|
inlinevirtualinherited |
It sets the DataSetType associated to the constraint.
dt | The DataSetType associated to this constraint. |
Definition at line 143 of file Constraint.h.
|
inlinevirtualinherited |
It sets the constraint identifier.
id | A number that identifies the constraint. |
Definition at line 112 of file Constraint.h.
|
inlinevirtualinherited |
It sets the constraint name.
name | The constraint name. |
Definition at line 126 of file Constraint.h.
|
inline |
It sets the action to be performed when a referenced element value in the referenced DataSetType is being deleted.
a | The action to be performed when a referenced element value in the referenced DataSetType is being deleted. |
Definition at line 174 of file ForeignKey.h.
|
inline |
It sets the action to be performed when a referenced element value in the referenced DataSetType is being updated to a new value.
a | The action to be performed when a referenced element value in the referenced DataSetType is being updated to a new value. |
Definition at line 188 of file ForeignKey.h.
|
inline |
It sets the properties that take part of the foreign key constraint.
properties | The properties that take part of the foreign key constraint. |
Definition at line 121 of file ForeignKey.h.
|
inline |
It sets the referenced DataSetType of this foreign key constraint.
refDt | The referenced DataSetType of this foreign key constraint. |
Definition at line 160 of file ForeignKey.h.
|
inline |
It sets the referenced properties (on the referenced DataSetType) of this foreign key constraint.
properties | The referenced properties (on the referenced DataSetType) of this foreign key constraint. |
Definition at line 146 of file ForeignKey.h.
|
private |
The action to be performed when a referenced element value in the referenced DataSetType is being deleted.
Definition at line 238 of file ForeignKey.h.
|
private |
The action to be performed when a referenced element value in the referenced DataSetType is being updated to a new value.
Definition at line 239 of file ForeignKey.h.
|
private |
The properties that are part of the foreign key constraint.
Definition at line 241 of file ForeignKey.h.
|
private |
The referenced DataSetType of this foreign key constraint.
Definition at line 240 of file ForeignKey.h.
|
private |
The referenced properties (on the referenced DataSetType) of this foreign key constraint.
Definition at line 242 of file ForeignKey.h.