PlexRelation<T extends PlexEntity, R extends PlexEntity> class

Represents a relation between two entity collections.

Use hasMany for one-to-many (e.g. Order has many OrderItems). Use belongsTo for many-to-one (e.g. Order belongs to Customer).

Properties

foreignKey String
final
hashCode int
The hash code for this object.
no setterinherited
isHasMany bool
final
ownerCollection PlexEntityCollection<T>
final
relatedCollection PlexEntityCollection<R>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

loadBelongsTo(T owner) Future<R?>
Load the related entity for a belongsTo relation. owner is the owner entity; foreignKey (set in belongsTo) is the field on owner holding the related id.
loadHasMany(int ownerId) Future<List<R>>
Load related entities for a hasMany relation. ownerId is the primary key of the owner (e.g. order.entityId).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited