DatumRelationSpec<E extends RelationalDatumEntity, R extends DatumEntityInterface>.belongsTo constructor
DatumRelationSpec<E extends RelationalDatumEntity, R extends DatumEntityInterface>.belongsTo (
- String name, {
- required DatumFieldSpec<
E, String> foreignKey, - String localKey = 'id',
- CascadeDeleteBehavior cascadeDelete = CascadeDeleteBehavior.none,
A to-one parent relation: the R whose localKey equals this entity's
foreignKey — the owning entity's own field spec
(e.g. Ticket.projectIdField on Ticket).
Implementation
DatumRelationSpec.belongsTo(
this.name, {
required DatumFieldSpec<E, String> foreignKey,
this.localKey = 'id',
this.cascadeDelete = CascadeDeleteBehavior.none,
}) : kind = DatumRelationKind.belongsTo,
foreignKeyName = foreignKey.name,
pivotType = null,
pivotOtherKeyName = null,
otherLocalKey = 'id';