It models a foreign key constraint for a DataSetType. More...
#include <ForeignKey.h>
Public Member Functions | |
void | add (const te::dt::Property *p) |
It adds a property to the foreign key constraint. More... | |
void | addRefProperty (const 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 (const ForeignKey &rhs) | |
Copy constructor not allowed. More... | |
ForeignKey (const std::string &name, unsigned int id=0) | |
Constructor. More... | |
ForeignKey (unsigned int id=0) | |
Constructor. 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 (const std::string &propertyName) |
It verifies if Property takes part of the foreign key. More... | |
bool | isReferenced (const std::string &propertyName) |
It verifies if Property is referenced by the foreign key. More... | |
ForeignKey & | operator= (const ForeignKey &rhs) |
Assignment operator. More... | |
void | replace (const std::string &propName, const 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 | setReferencedDataSetType (DataSetType *refDt) |
It sets the referenced DataSetType of this foreign key constraint. More... | |
~ForeignKey () | |
Destructor. More... | |
Private Attributes | |
DataSetType * | m_dt |
The associated DataSetType. More... | |
unsigned int | m_id |
An identification number for the constraint. More... | |
std::string | m_name |
The constraint name. More... | |
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 48 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. |
te::da::ForeignKey::~ForeignKey | ( | ) |
Destructor.
|
inline |
It adds a property to the foreign key constraint.
p | The property to be added to the foreign key constraint. |
Definition at line 110 of file ForeignKey.h.
References te::dt::Property::clone().
|
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 126 of file ForeignKey.h.
References te::dt::Property::clone().
|
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 147 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 161 of file ForeignKey.h.
|
inline |
It returns the properties that take part of the foreign key constraint.
Definition at line 101 of file ForeignKey.h.
|
inline |
It returns the referenced DataSetType of this foreign key constraint.
Definition at line 133 of file ForeignKey.h.
|
inline |
It returns the referenced properties (on the referenced DataSetType) of this foreign key constraint.
Definition at line 117 of file ForeignKey.h.
|
inlinevirtual |
It returns the constraint type: FOREIGNKEY.
Implements te::da::Constraint.
Definition at line 205 of file ForeignKey.h.
References te::da::FOREIGN_KEY.
bool te::da::ForeignKey::has | ( | const std::string & | propertyName | ) |
It verifies if Property takes part of the foreign key.
propertyName | The Property name to be verified. |
bool te::da::ForeignKey::isReferenced | ( | const std::string & | propertyName | ) |
It verifies if Property is referenced by the foreign key.
propertyName | The Property name 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 | ( | const std::string & | propName, |
const te::dt::Property * | pp | ||
) |
It changes a reference to property p to pp.
propName | A property name 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 154 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 168 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 140 of file ForeignKey.h.
|
privateinherited |
The associated DataSetType.
Definition at line 166 of file Constraint.h.
|
privateinherited |
An identification number for the constraint.
Definition at line 165 of file Constraint.h.
|
privateinherited |
The constraint name.
Definition at line 167 of file Constraint.h.
|
private |
The action to be performed when a referenced element value in the referenced DataSetType is being deleted.
Definition at line 218 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 219 of file ForeignKey.h.
|
private |
The properties that are part of the foreign key constraint.
Definition at line 221 of file ForeignKey.h.
|
private |
The referenced DataSetType of this foreign key constraint.
Definition at line 220 of file ForeignKey.h.
|
private |
The referenced properties (on the referenced DataSetType) of this foreign key constraint.
Definition at line 222 of file ForeignKey.h.