|
@@ -31,8 +31,8 @@ class CORE_EXPORT QgsRelation |
|
|
/** |
|
|
* Defines a relation between matching fields of the two involved tables of a relation. |
|
|
* Often, a relation is only defined by just one FieldPair with the name of the foreign key |
|
|
* column of the referencing table as first element and the name of the primary key column |
|
|
* of the referenced table as the second element. |
|
|
* column of the referencing (child) table as first element and the name of the primary key column |
|
|
* of the referenced (parent) table as the second element. |
|
|
* @note not available in Python bindings |
|
|
*/ |
|
|
class FieldPair : public QPair< QString, QString > |
|
@@ -46,9 +46,9 @@ class CORE_EXPORT QgsRelation |
|
|
FieldPair( const QString& referencingField, const QString& referencedField ) |
|
|
: QPair< QString, QString >( referencingField, referencedField ) {} |
|
|
|
|
|
//! Get the name of the referencing field |
|
|
//! Get the name of the referencing (child) field |
|
|
QString referencingField() const { return first; } |
|
|
//! Get the name of the referenced field |
|
|
//! Get the name of the referenced (parent) field |
|
|
QString referencedField() const { return second; } |
|
|
}; |
|
|
|
|
@@ -89,32 +89,32 @@ class CORE_EXPORT QgsRelation |
|
|
void setRelationName( const QString& name ); |
|
|
|
|
|
/** |
|
|
* Set the referencing layer id. This layer will be searched in the registry. |
|
|
* Set the referencing (child) layer id. This layer will be searched in the registry. |
|
|
* |
|
|
* @param id |
|
|
*/ |
|
|
void setReferencingLayer( const QString& id ); |
|
|
|
|
|
/** |
|
|
* Set the referenced layer id. This layer will be searched in the registry. |
|
|
* Set the referenced (parent) layer id. This layer will be searched in the registry. |
|
|
* |
|
|
* @param id |
|
|
*/ |
|
|
void setReferencedLayer( const QString& id ); |
|
|
|
|
|
/** |
|
|
* Add a field pairs which is part of this relation |
|
|
* The first element of each pair are the field names fo the foreign key. |
|
|
* The first element of each pair are the field names of the foreign key. |
|
|
* The second element of each pair are the field names of the matching primary key. |
|
|
* |
|
|
* @param referencingField The field name on the referencing layer (FK) |
|
|
* @param referencedField The field name on the referenced layer (PK) |
|
|
* @param referencingField The field name on the referencing (child) layer (FK) |
|
|
* @param referencedField The field name on the referenced (parent) layer (PK) |
|
|
*/ |
|
|
void addFieldPair( const QString& referencingField, const QString& referencedField ); |
|
|
|
|
|
/** |
|
|
* Add a field pairs which is part of this relation |
|
|
* The first element of each pair are the field names fo the foreign key. |
|
|
* The first element of each pair are the field names of the foreign key. |
|
|
* The second element of each pair are the field names of the matching primary key. |
|
|
* |
|
|
* @param fieldPair A pair of two strings |
|
@@ -221,7 +221,7 @@ class CORE_EXPORT QgsRelation |
|
|
|
|
|
/** |
|
|
* Returns the field pairs which form this relation |
|
|
* The first element of each pair are the field names fo the foreign key. |
|
|
* The first element of each pair are the field names of the foreign key. |
|
|
* The second element of each pair are the field names of the matching primary key. |
|
|
* |
|
|
* @return The fields forming the relation |
|
@@ -230,15 +230,15 @@ class CORE_EXPORT QgsRelation |
|
|
|
|
|
/** |
|
|
* Returns a list of attributes used to form the referenced fields |
|
|
* (most likely primary key) on the referenced layer. |
|
|
* (most likely primary key) on the referenced (parent) layer. |
|
|
* |
|
|
* @return A list of attributes |
|
|
*/ |
|
|
QgsAttributeList referencedFields() const; |
|
|
|
|
|
/** |
|
|
* Returns a list of attributes used to form the referencing fields |
|
|
* (foreign key) on the referencing layer. |
|
|
* (foreign key) on the referencing (child) layer. |
|
|
* |
|
|
* @return A list of attributes |
|
|
*/ |
|
|