Backlink class

Backlink annotation specifies a link in a reverse direction of another relation.

This works as an "updatable view" of the original relation, and doesn't cause any more data to be stored in the database. Changes made to the backlink relation are reflected in the original direction.

Example - backlink based on a ToOne relation:

class Order {
  final customer = ToOne<Customer>();
}
class Customer {
  @Backlink()
  final orders = ToMany<Customer>();
}

Example - backlink based on a ToMany relation:

class Student {
  final teachers = ToMany<Teacher>();
}
class Teacher {
  @Backlink()
  final students = ToMany<Student>();
}

Constructors

If there are multiple relations pointing to the current entity, specify the field name of the desired source relation: Backlink('sourceField').
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
to String
Target entity to which this backlink points. It's the entity that contains a ToOne or ToMany relation pointing to the current entity.
final

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