kexi
KexiDB::Relationship Class Reference
List of all members.Detailed Description
Definition at line 77 of file relationship.h.
Public Types | |
typedef QPtrList< Relationship > | List |
typedef QPtrListIterator< Relationship > | ListIterator |
Public Member Functions | |
Relationship () | |
Relationship (IndexSchema *masterIndex, IndexSchema *detailsIndex) | |
virtual | ~Relationship () |
IndexSchema * | masterIndex () const |
IndexSchema * | detailsIndex () const |
Field::PairList * | fieldPairs () |
bool | isEmpty () const |
TableSchema * | masterTable () const |
TableSchema * | detailsTable () const |
void | setIndices (IndexSchema *masterIndex, IndexSchema *detailsIndex) |
Protected Member Functions | |
Relationship (QuerySchema *query, Field *field1, Field *field2) | |
void | createIndices (QuerySchema *query, Field *field1, Field *field2) |
void | setIndices (IndexSchema *masterIndex, IndexSchema *detailsIndex, bool ownedByMaster) |
Protected Attributes | |
IndexSchema * | m_masterIndex |
IndexSchema * | m_detailsIndex |
Field::PairList | m_pairs |
bool | m_masterIndexOwned: 1 |
bool | m_detailsIndexOwned: 1 |
Friends | |
class | Connection |
class | TableSchema |
class | QuerySchema |
class | IndexSchema |
Constructor & Destructor Documentation
Relationship::Relationship | ( | ) |
Creates uninitialized Relationship object. setIndices() will be required to call.
Definition at line 31 of file relationship.cpp.
Relationship::Relationship | ( | IndexSchema * | masterIndex, | |
IndexSchema * | detailsIndex | |||
) |
Creates Relationship object and initialises it just by calling setIndices(). If setIndices() failed, object is still uninitialised.
Definition at line 40 of file relationship.cpp.
Member Function Documentation
IndexSchema* KexiDB::Relationship::detailsIndex | ( | ) | const [inline] |
- Returns:
- index defining referenced side of this relationship. or null if there is no information defined.
Definition at line 101 of file relationship.h.
TableSchema * Relationship::detailsTable | ( | ) | const |
- Returns:
- table assigned at "details / many / foreign" side of this relationship. or null if there is no information defined.
Definition at line 145 of file relationship.cpp.
Field::PairList* KexiDB::Relationship::fieldPairs | ( | ) | [inline] |
- Returns:
- ordered list of field pairs -- alternative form for representation of relationship or null if there is no information defined. Each pair has a form of <master-side-field, details-side-field>.
Definition at line 106 of file relationship.h.
IndexSchema* KexiDB::Relationship::masterIndex | ( | ) | const [inline] |
- Returns:
- index defining master side of this relationship or null if there is no information defined.
Definition at line 97 of file relationship.h.
TableSchema * Relationship::masterTable | ( | ) | const |
- Returns:
- table assigned at "master / one" side of this relationship. or null if there is no information defined.
Definition at line 140 of file relationship.cpp.
void Relationship::setIndices | ( | IndexSchema * | masterIndex, | |
IndexSchema * | detailsIndex, | |||
bool | ownedByMaster | |||
) | [protected] |
Internal version of setIndices(). ownedByMaster parameter is passed to IndexSchema::attachRelationship()
Definition at line 155 of file relationship.cpp.
void Relationship::setIndices | ( | IndexSchema * | masterIndex, | |
IndexSchema * | detailsIndex | |||
) |
Sets masterIndex and detailsIndex indices for this relationship. This also sets information about tables for master- and details- sides. Notes:
- both indices must contain the same number of fields
- both indices must not be owned by the same table, and table (owner) must be not null.
- corresponding field types must be the same
- corresponding field types' signedness must be the same If above rules are not fulfilled, information about this relationship is cleared. On success, this Relationship object is detached from previous IndexSchema objects that were assigned before, and new are attached.
Definition at line 150 of file relationship.cpp.
The documentation for this class was generated from the following files: