The "local" model field.
The virtual/computed field on the local model that should contain the related model.
Whether this relationship everything necessary to get, set, and query from the perspective of the local model provided at instantiation.
The constructor that can be used to query DataStore or create instance for the local model.
The field names on the local model that can be used to query or queried to match with instances of the remote model.
Fields are returned in-order to match the order of this.remoteKeyFields
.
The field names on the local model that uniquely identify it.
These fields may or may not be relevant to the join fields.
The field names on the remote model that can used to query or queried to match with instances of the local model.
Fields are returned in-order to match the order of this.localKeyFields
.
Constructor that can be used to query DataStore or create instances for the remote model.
The field names on the remote model that uniquely identify it.
These fields may or may not be relevant to the join fields.
The name/type of the relationship the local model has with the remote model via the defined local model field.
Creates an FK mapper object with respect to the given related instance.
E.g., if the local FK fields are [parentId, parentName]
and point to
[customId, name]
on the remote model, createLocalFKObject(remote)
will return:
{
parentId: remote.customId,
parentName: remote.name
}
The remote related instance.
Creates an query mapper object to help fetch the remote instance(s) or
null
if any of the necessary local fields are null
or undefined
.
E.g., if the local FK fields are [parentId, parentName]
and point to
[customId, name]
on the remote model, createLocalFKObject(remote)
will return:
{
customId: local.parentId
name: local.parentName
}
If the local fields are not populated, returns
The local instance.
Enumerates all valid ModelRelationship
's on the given model.
The model definition to enumerate relationships of.
Returns a ModelRelationship for the the given model and field if the pair
indicates a relationship to another model. Else, returns null
.
The model the relationship field exists in.
The field that may relates the local model to the remote model.
Defines a relationship from a LOCAL model.field to a REMOTE model.field and helps navigate the relationship, providing a simplified peek at the relationship details pertinent to setting FK's and constructing join conditions.
Because I mean, relationships are tough.