It describes a primary key (pk) constraint.
More...
#include <PrimaryKey.h>
It describes a primary key (pk) constraint.
- See also
- DataSetType, UniqueKey, ForeignKey, CheckConstraint
Definition at line 52 of file PrimaryKey.h.
te::da::PrimaryKey::PrimaryKey |
( |
DataSetType * |
dt = 0 , |
|
|
unsigned int |
id = 0 |
|
) |
| |
Constructor.
- Parameters
-
dt | The DataSetType associated to the pk. |
id | The pk identifier. |
- Postcondition
- If dt is provided, the pk will belong to the given DataSetType.
- Warning
- The identifier value (id) may be used by data source implementations. So, don't rely on its value!
te::da::PrimaryKey::PrimaryKey |
( |
const std::string & |
name, |
|
|
DataSetType * |
dt = 0 , |
|
|
unsigned int |
id = 0 |
|
) |
| |
Constructor.
- Parameters
-
name | The primary key constraint name. |
dt | The DataSetType associated to the pk. |
id | The pk identifier. |
- Postcondition
- If dt is provided, the pk will belong to the given DataSetType.
- Warning
- The identifier value (id) may be used by data source implementations. So, don't rely on its value!
te::da::PrimaryKey::PrimaryKey |
( |
const PrimaryKey & |
rhs | ) |
|
Copy constructor.
The new object will not have an assigned DataSetType.
- Parameters
-
rhs | Right-hand-side instance. |
te::da::PrimaryKey::~PrimaryKey |
( |
| ) |
|
|
inline |
It adds a property to the list of properties of the primary key.
- Parameters
-
p | The property that will take part of the primary key. |
Definition at line 123 of file PrimaryKey.h.
It returns a clone of the object.
The new object will not have an associated DataSetType.
- Returns
- A clone of the object.
Implements te::da::Constraint.
Index* te::da::PrimaryKey::getAssociatedIndex |
( |
| ) |
const |
|
inline |
It returns the associated index if one exists.
- Returns
- An associated index if one exists.
Definition at line 137 of file PrimaryKey.h.
virtual DataSetType* te::da::Constraint::getDataSetType |
( |
| ) |
const |
|
inlinevirtualinherited |
virtual unsigned int te::da::Constraint::getId |
( |
| ) |
const |
|
inlinevirtualinherited |
It returns the constraint identifier.
- Returns
- A number that identifies the constraint.
- Warning
- The identifier value (id) may be used by data source implementations. So, don't rely on its value!
Definition at line 103 of file Constraint.h.
virtual const std::string& te::da::Constraint::getName |
( |
| ) |
const |
|
inlinevirtualinherited |
It returns the constraint name.
- Returns
- The constraint name.
Definition at line 119 of file Constraint.h.
const std::vector<te::dt::Property*>& te::da::PrimaryKey::getProperties |
( |
| ) |
const |
|
inline |
It returns the properties that take part of the primary key.
- Returns
- The properties that take part of the primary key.
Definition at line 109 of file PrimaryKey.h.
It verifies if Property is associated to the primary key.
- Parameters
-
p | The Property to be verified. |
- Returns
- True if Property is associated to the primary key, false otherwise.
Assignment operator.
The new object will not have an assigned DataSetType.
- Parameters
-
rhs | Right-hand-side instance. |
- Returns
- A reference to this.
It changes a reference to property p to pp.
- Parameters
-
p | A property that takes part of the primary key. |
pp | The property that will take p place. |
- Note
- If p is not found in the primary key attribute list this method does nothing.
void te::da::PrimaryKey::setAssociatedIndex |
( |
Index * |
idx | ) |
|
|
inline |
It sets the associated index.
- Parameters
-
idx | If the primary key is associated to an index, this method will associate them. |
Definition at line 130 of file PrimaryKey.h.
virtual void te::da::Constraint::setDataSetType |
( |
DataSetType * |
dt | ) |
|
|
inlinevirtualinherited |
It sets the DataSetType associated to the constraint.
- Parameters
-
- Warning
- Take care when calling this method. If the constraint belongs to a DataSetType, remember to detach it from the DataSetType before calling this method.
Definition at line 143 of file Constraint.h.
virtual void te::da::Constraint::setId |
( |
unsigned int |
id | ) |
|
|
inlinevirtualinherited |
It sets the constraint identifier.
- Parameters
-
id | A number that identifies the constraint. |
- Warning
- The identifier value (id) may be used by data source implementations. So, don't rely on its value!
Definition at line 112 of file Constraint.h.
virtual void te::da::Constraint::setName |
( |
const std::string & |
name | ) |
|
|
inlinevirtualinherited |
It sets the constraint name.
- Parameters
-
Definition at line 126 of file Constraint.h.
void te::da::PrimaryKey::setProperties |
( |
const std::vector< te::dt::Property * > & |
properties | ) |
|
|
inline |
It sets the properties that form the primary key.
- Parameters
-
properties | The properties that form the primary key. |
Definition at line 116 of file PrimaryKey.h.
Index* te::da::PrimaryKey::m_index |
|
private |
A pointer to an associated index.
Definition at line 176 of file PrimaryKey.h.
The properties that take part of primary key constraint.
Definition at line 177 of file PrimaryKey.h.
The documentation for this class was generated from the following file:
- /home/castejon/castejon_files/develop/terralib5/git_master/src/terralib/dataaccess/dataset/PrimaryKey.h