JunctionLink
Class: JunctionLink<T, K>
Defined in: packages/models/src/relations.ts:1303
Define a junction link between two models in a n:m relation
This is used to define the junction model in a n:m relation with additional data It does not require to have a symetric relation on the other side
linkA is a ModelParent: deleting the model it targets deletes the junction (CASCADE).
Type Parameters
T
T extends Storable
K
K extends Storable
Implements
Constructors
Constructor
new JunctionLink<
T,K>():JunctionLink<T,K>
Returns
JunctionLink<T, K>
Properties
[WEBDA_PRIMARY_KEY]
[WEBDA_PRIMARY_KEY]: readonly [
"linkA","linkB"]
Defined in: packages/models/src/relations.ts:1307
[webda primary key]
Implementation of
linkA
linkA:
ModelParent<T>
Defined in: packages/models/src/relations.ts:1311
Link a
linkB
linkB:
ModelLink<K>
Defined in: packages/models/src/relations.ts:1315
Link b
Methods
getPrimaryKey()
getPrimaryKey():
object
Defined in: packages/models/src/relations.ts:1320
Return the composite primary key (linkA + linkB)
Returns
object
the composite primary key object
linkA
linkA:
PrimaryKeyType<T>
linkB
linkB:
PrimaryKeyType<K>
Implementation of
getUUID()
getUUID():
string
Defined in: packages/models/src/relations.ts:1331
Return a string UID combining both link keys
Returns
string
the combined UID string
Implementation of
load()
load(
params):this
Defined in: packages/models/src/relations.ts:1324
Parameters
params
any
Returns
this
Implementation of
toProxy()
toProxy():
JunctionLink<T,K>
Defined in: packages/models/src/relations.ts:1338
Return the proxied version of this model (identity for JunctionLink)
Returns
JunctionLink<T, K>
this instance