|
QEloquent 1.1.0
Qt most flexible ORM.
|
User-facing class for managing model relationships. More...
#include <relation.h>
Inherits QEloquent::Entity, QEloquent::AbstractItemProxy< T >, QEloquent::AbstractListProxy< T >, and Serializable.
Public Member Functions | |
| Relation () | |
| Default constructor (uninitialized) | |
| Relation (const QString &name, ParentModel *parent, const std::function< RelationData *()> &creationCallback) | |
| Internal constructor used by Model factory methods. | |
| Relation (const std::source_location &location, const ParentModel *parent, const std::function< RelationData *()> &creationCallback) | |
| Constructor. | |
| Relation (const Relation &other)=default | |
| Copy constructor. | |
| Relation (Relation &&other)=default | |
| Move constructor. | |
| Relation< Model > & | operator= (const Relation &other)=default |
| Copy assignment operator. | |
| Relation< Model > & | operator= (Relation &&other)=default |
| Move assignment operator. | |
| bool | hasPivotData (int index, const QString &name) const |
| Check if associated metadata exists at a given index. | |
| QVariant | pivotData (int index, const QString &name) const |
| Retrieve associated metadata. | |
| void | setPivotData (int index, const QString &name, const QVariant &value) |
| Set associated metadata. | |
| bool | exists () override |
| Returns true if related models exist in the database (triggers load) | |
| bool | get () override |
| Manually fetches related models from the database. | |
| bool | save () override |
| Unsupported for relations directly. | |
| bool | insert () override |
| Unsupported for relations directly. | |
| bool | update () override |
| Unsupported for relations directly. | |
| bool | deleteData () override |
| Unsupported for relations directly. | |
| QList< RelatedModel > | related () const |
| Explicitly returns the list of related models. | |
User-facing class for managing model relationships.
Relationships are accessed as methods on the model:
| Model | The type of the related model. |