DatumRelationSpec<E extends RelationalDatumEntity, R extends DatumEntityInterface>.belongsTo constructor

DatumRelationSpec<E extends RelationalDatumEntity, R extends DatumEntityInterface>.belongsTo(
  1. String name, {
  2. required DatumFieldSpec<E, String> foreignKey,
  3. String localKey = 'id',
  4. 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';