DatumRelationSchema class abstract final

A global registry mapping an entity Type to its relation schema.

Populated automatically the first time the engine sees an instance of a relational entity (e.g. on push/read), and/or explicitly via register / registerFromInstance. Once registered, adapters can traverse relations by type alone — no entity instance required (#21):

final debtRels = DatumRelationSchema.of(Debt);           // {lenderGroup: ...}
final groupType = debtRels!['lenderGroup']!.targetType;  // Group
final memberType = DatumRelationSchema.descriptor(groupType, 'members')!.targetType;

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Static Properties

registeredTypes Iterable<Type>
All registered entity types.
no setter

Static Methods

clear() → void
Clears the registry (primarily for tests).
descriptor(Type type, String name) RelationDescriptor?
The descriptor for relation name on type, or null.
isRegistered(Type type) bool
Whether a schema is registered for type.
of(Type type) Map<String, RelationDescriptor>?
The relation schema registered for type, or null if none.
register(Type type, Map<String, RelationDescriptor> schema) → void
Registers schema for type, replacing any existing registration.