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. |
Definition at line 31 of file ForeignKey.cpp.
te::da::ForeignKey::ForeignKey | ( | const std::string & | name, |
unsigned int | id = 0 |
||
) |
Constructor.
name | The foreign key constraint name. |
id | The fk identifier. |
Definition at line 39 of file ForeignKey.cpp.
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. |
Definition at line 48 of file ForeignKey.cpp.
|
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.
Referenced by te::da::DataSetType::DataSetType(), te::pgis::Transactor::getConstraints(), and te::pgis::Transactor::getForeignKey().
|
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.
Referenced by te::pgis::Transactor::getConstraints(), and te::pgis::Transactor::getForeignKey().
|
virtual |
It returns a clone of the object.
The new object will not have an associated DataSetType.
Implements te::da::Constraint.
Definition at line 125 of file ForeignKey.cpp.
|
inlinevirtualinherited |
It returns the DataSetType associated to the constraint.
Definition at line 133 of file Constraint.h.
Referenced by te::da::DataSourceCatalog::dropDependentFKs(), and te::da::DataSetType::remove().
|
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.
Referenced by te::pgis::Transactor::addCheckConstraint(), te::qt::widgets::ConstraintsIndexesListWidget::addConstraint(), te::pgis::Transactor::addForeignKey(), te::pgis::Transactor::addPrimaryKey(), te::sqlite::DataSourceTransactor::addUniqueKey(), te::pgis::Transactor::addUniqueKey(), te::pgis::Transactor::createDataSet(), te::da::DataSetType::DataSetType(), te::da::DataSetTypeConverter::DataSetTypeConverter(), DSInfo::getCheckConstraintInfo(), te::pgis::Transactor::getConstraints(), te::attributefill::RasterToVector::getDataSetType(), DSInfo::getForeignKeyInfo(), te::sqlite::DataSourceCatalogLoader::getIndex(), te::pgis::Transactor::getIndexes(), te::pgis::Transactor::getPrimaryKey(), DSInfo::getPrimaryKeyInfo(), te::qt::widgets::TableLinkDialog::getProperties(), te::pgis::Transactor::getUniqueKey(), DSInfo::getUniqueKeyInfo(), te::qt::widgets::ConstraintsIndexesListWidget::onEditToolButtonClicked(), te::stmem::Transactor::primaryKeyExists(), te::qt::widgets::ConstraintsIndexesListWidget::removePrimaryKey(), te::qt::widgets::ConstraintsIndexesListWidget::removeUniqueKey(), te::qt::widgets::PrimaryKeyConstraintWidget::setConstraint(), and te::qt::widgets::UniqueKeyConstraintWidget::setConstraint().
|
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.
Referenced by te::pgis::Transactor::addForeignKey(), and te::da::DataSetType::DataSetType().
|
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.
Referenced by te::pgis::Transactor::addForeignKey(), and te::da::DataSetType::DataSetType().
|
inline |
It returns the properties that take part of the foreign key constraint.
Definition at line 103 of file ForeignKey.h.
Referenced by te::ado::Transactor::addForeignKey(), te::pgis::Transactor::addForeignKey(), te::sqlite::DataSourceTransactor::createDataSet(), te::da::DataSetType::DataSetType(), and Utils::getFKPropertiesNames().
|
inline |
It returns the referenced DataSetType of this foreign key constraint.
Definition at line 153 of file ForeignKey.h.
Referenced by te::ado::Transactor::addForeignKey(), te::pgis::Transactor::addForeignKey(), te::da::DataSourceCatalog::addRef(), te::da::DataSourceCatalog::checkFKsDependency(), te::sqlite::DataSourceTransactor::createDataSet(), te::da::DataSetType::DataSetType(), te::da::DataSourceCatalog::indexFKs(), and te::da::DataSourceCatalog::removeRef().
|
inline |
It returns the referenced properties (on the referenced DataSetType) of this foreign key constraint.
Definition at line 128 of file ForeignKey.h.
Referenced by te::ado::Transactor::addForeignKey(), te::pgis::Transactor::addForeignKey(), te::sqlite::DataSourceTransactor::createDataSet(), and te::da::DataSetType::DataSetType().
|
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. |
Definition at line 78 of file ForeignKey.cpp.
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. |
Definition at line 89 of file ForeignKey.cpp.
te::da::ForeignKey & te::da::ForeignKey::operator= | ( | const ForeignKey & | rhs | ) |
Assignment operator.
The new object will not have an assigned DataSetType.
rhs | Right-hand-side instance. |
Definition at line 58 of file ForeignKey.cpp.
References m_onDelete, m_onUpdate, m_properties, m_refDt, m_refProperties, and te::da::Constraint::operator=().
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. |
Definition at line 100 of file ForeignKey.cpp.
|
inlinevirtualinherited |
It sets the DataSetType associated to the constraint.
dt | The DataSetType associated to this constraint. |
Definition at line 143 of file Constraint.h.
Referenced by te::da::DataSetType::add(), te::da::DataSetType::DataSetType(), and te::da::DataSetType::setPrimaryKey().
|
inlinevirtualinherited |
It sets the constraint identifier.
id | A number that identifies the constraint. |
Definition at line 112 of file Constraint.h.
Referenced by te::pgis::Transactor::getCheckConstraint(), and te::pgis::Transactor::getConstraints().
|
inlinevirtualinherited |
It sets the constraint name.
name | The constraint name. |
Definition at line 126 of file Constraint.h.
Referenced by te::pgis::Transactor::addPrimaryKey(), te::qt::widgets::DataSetOptionsWizardPage::applyChanges(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), te::sqlite::DataSourceTransactor::createDataSet(), te::qt::widgets::DirectExchangerDialog::exchangeToDatabase(), te::qt::widgets::PrimaryKeyConstraintWidget::getConstraint(), te::qt::widgets::UniqueKeyConstraintWidget::getConstraint(), te::attributefill::RasterToVector::getDataSetType(), and te::qt::widgets::DataSetOptionsWizardPage::set().
|
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.
Referenced by te::da::DataSetType::DataSetType(), te::pgis::Transactor::getConstraints(), and te::pgis::Transactor::getForeignKey().
|
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.
Referenced by te::da::DataSetType::DataSetType(), te::pgis::Transactor::getConstraints(), and te::pgis::Transactor::getForeignKey().
|
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.
Referenced by te::ado::Convert2Terralib().
|
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.
Referenced by te::da::DataSetType::DataSetType(), te::pgis::Transactor::getConstraints(), and te::pgis::Transactor::getForeignKey().
|
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.
Referenced by te::da::DataSetType::DataSetType().
|
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.
Referenced by operator=().
|
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.
Referenced by operator=().
|
private |
The properties that are part of the foreign key constraint.
Definition at line 241 of file ForeignKey.h.
Referenced by operator=().
|
private |
The referenced DataSetType of this foreign key constraint.
Definition at line 240 of file ForeignKey.h.
Referenced by operator=().
|
private |
The referenced properties (on the referenced DataSetType) of this foreign key constraint.
Definition at line 242 of file ForeignKey.h.
Referenced by operator=().