HasMany<TModel> class abstract

Represents a one-to-many relationship

Example:

class User {
  HasMany<Post> get posts => HasMany<Post>(
    database: database,
    foreignKey: 'user_id',
    localKey: id,
  );
}

Constructors

HasMany({required DatabaseConnectionUser database, required TableInfo<Table, dynamic> table, required String foreignKey, required dynamic localKey})

Properties

database DatabaseConnectionUser
final
foreignKey String
final
hashCode int
The hash code for this object.
no setterinherited
localKey → dynamic
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
table TableInfo<Table, dynamic>
final

Methods

buildForeignKeyCondition(dynamic tbl) Expression<bool>
Build the foreign key condition
get() Future<List<TModel>>
Get all related models
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