RelationalDatumEntityMixin mixin

A mixin for entities that manage relationships to other DatumEntityBase entities.

This should be mixed into any class that uses DatumEntityMixin and also defines relations, such as 'one-to-many' or 'many-to-many'.

Superclass constraints
Implemented types

Properties

createdAt DateTime
The timestamp of when this entity was first created.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
A unique identifier for the entity.
no setterinherited
isDeleted bool
A flag indicating if this entity has been locally marked for deletion.
no setterinherited
modifiedAt DateTime
The timestamp of the last time this entity was modified. This is a crucial field for determining sync conflicts and order.
no setterinherited
props List<Object?>
Provides the list of properties to be used by the Equatable mixin for value equality checks.
no setterinherited
relations Map<String, Relation>
A map of relationship definitions.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
userId String
The ID of the user who owns or created this entity.
no setterinherited
version int
A sequential integer used for optimistic concurrency and tracking changes. It increments with every modification.
no setterinherited

Methods

copyWith({DateTime? modifiedAt, int? version, bool? isDeleted}) DatumEntityMixin
Creates a new instance of the entity with updated values.
inherited
diff(covariant DatumEntityBase oldVersion) Map<String, dynamic>?
Computes the difference between the current entity state and an oldVersion of the entity.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDatumMap({MapTarget target = MapTarget.local}) Map<String, dynamic>
Converts the entity to a Map<String, dynamic> for persistence.
inherited
toString() String
A string representation of this object.
inherited

Operators

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