DbRelation class
Relação entre dois models — usada para gerar joins/includes padronizados.
Ex.: um pedido belongsTo cliente; um cliente hasMany pedidos.
Constructors
- DbRelation({required RelationKind kind, required String name, required String table, required String foreignKey, String localKey = 'id'})
-
const
- DbRelation.belongsTo(String name, {required String table, required String foreignKey})
-
factory
- DbRelation.hasMany(String name, {required String table, required String foreignKey})
-
factory
Properties
- foreignKey → String
-
Coluna que guarda a referência.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- kind → RelationKind
-
final
- localKey → String
-
Coluna referenciada (normalmente
id).final - name → String
-
Nome da relação exposto no resultado (ex.:
customer,items).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- table → String
-
Tabela relacionada.
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