HasOne<TModel> class abstract

Represents a one-to-one relationship

Example:

class User {
  HasOne<Profile> get profile => HasOne<Profile>(
    database: database,
    foreignKey: 'user_id',
    localKey: id,
  );
}

Constructors

HasOne({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<TModel?>
Get the related model
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