HasOne class

Represents a one-to-one relationship from the "one" side.

This is the inverse of a BelongsTo relationship.

foreignKey: The field on the related entity that holds the ID of this entity. localKey: The field on this entity that the foreignKey on the related entity points to. Defaults to 'id'.

Example: A User entity might have a HasOne('userId') to link to a single Profile entity, where the Profile has a unique userId field.

Inheritance

Constructors

HasOne(String foreignKey, {String localKey = 'id'})
const

Properties

foreignKey String
final
hashCode int
The hash code for this object.
no setterinherited
localKey String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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