LoadableEntity
Index
Methods
Methods
load
Ensures this entity is loaded (without reloading it if it already is). Returns the entity, or
nullif it was not found in the database (e.g. it was deleted in the meantime, or active filters disallow loading it). UseloadOrFail()if you want an error to be thrown in such a case.Parameters
optionaloptions: LoadReferenceOptions<Entity, Hint, Fields, Excludes>
Returns Promise<null | Loaded<Entity, Hint, Fields, Excludes>>
loadOrFail
Ensures this entity is loaded (without reloading it if it already is). Returns the entity, or throws an error just like
em.findOneOrFail()(and respects the same config options) if it was not found.Parameters
optionaloptions: LoadReferenceOrFailOptions<Entity, Hint, Fields, Excludes>
Returns Promise<Loaded<Entity, Hint, Fields, Excludes>>
The
load()/loadOrFail()methods added by the Loadable mixin. Declared as an interface so the mixin function can have an explicit return type (required by JSR fast-check).