WrappedEntity <Entity>
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
entity: Entity
hydrator: IHydrator
optionalpkGetter: (e: Entity) => Entity extends { [PrimaryKeyProp]?: PK } ? PK extends keyof Entity<Entity> ? ReadonlyPrimary<UnwrapPrimary<Entity<Entity>[PK<PK>]>> : PK extends keyof Entity<Entity>[] ? ReadonlyPrimary<PrimaryPropToType<Entity<Entity>, PK<PK>>> : PK : Entity extends { _id?: PK } ? string | ReadonlyPrimary<PK> : Entity extends { uuid?: PK } ? ReadonlyPrimary<PK> : Entity extends { id?: PK } ? ReadonlyPrimary<PK> : Entity
optionalpkSerializer: (e: Entity) => string
optionalpkGetterConverted: (e: Entity) => Entity extends { [PrimaryKeyProp]?: PK } ? PK extends keyof Entity<Entity> ? ReadonlyPrimary<UnwrapPrimary<Entity<Entity>[PK<PK>]>> : PK extends keyof Entity<Entity>[] ? ReadonlyPrimary<PrimaryPropToType<Entity<Entity>, PK<PK>>> : PK : Entity extends { _id?: PK } ? string | ReadonlyPrimary<PK> : Entity extends { uuid?: PK } ? ReadonlyPrimary<PK> : Entity extends { id?: PK } ? ReadonlyPrimary<PK> : Entity
Returns WrappedEntity<Entity>
Properties
__data
optional__em
optional__identifier
__initialized
__loadedProperties
optional__managed
optional__onLoadFired
optional__originalEntityData
holds last entity data snapshot, so we can compute changes when persisting managed entities
optional__pk
stores last known primary key, as its current state might be broken due to propagation/orphan removal, but we need to know the PK to be able t remove the entity
optional__populated
__processing
optional__reference
holds the reference wrapper instance (if created), so we can maintain the identity on reference wrappers too
optional__schema
__serializationContext
Type declaration
optionalexclude?: readonly string[]
optionalfields?: Set<string>
optionalpopulate?: PopulateOptions<Entity>[]
optionalroot?: SerializationContext<Entity>
__touched
Accessors
__config
__meta
Returns EntityMetadata<Entity>
__platform
Returns Platform
__primaryKeys
Returns (Entity extends { [PrimaryKeyProp]?: PK } ? PK extends keyof Entity<Entity> ? ReadonlyPrimary<UnwrapPrimary<Entity<Entity>[PK<PK>]>> : PK extends keyof Entity<Entity>[] ? ReadonlyPrimary<PrimaryPropToType<Entity<Entity>, PK<PK>>> : PK : Entity extends { _id?: PK } ? string | ReadonlyPrimary<PK> : Entity extends { uuid?: PK } ? ReadonlyPrimary<PK> : Entity extends { id?: PK } ? ReadonlyPrimary<PK> : Entity)[]
Methods
assign
Parameters
data: Data & IsSubset<EntityData<Naked>, Data>
optionaloptions: AssignOptions<Convert>
Returns MergeSelected<Entity, Naked, keyof Data & string>
getPrimaryKey
Parameters
convertCustomTypes: boolean = false
Returns null | (Entity extends { [PrimaryKeyProp]?: PK } ? PK extends keyof Entity<Entity> ? ReadonlyPrimary<UnwrapPrimary<Entity<Entity>[PK<PK>]>> : PK extends keyof Entity<Entity>[] ? ReadonlyPrimary<PrimaryPropToType<Entity<Entity>, PK<PK>>> : PK : Entity extends { _id?: PK } ? string | ReadonlyPrimary<PK> : Entity extends { uuid?: PK } ? ReadonlyPrimary<PK> : Entity extends { id?: PK } ? ReadonlyPrimary<PK> : Entity)
getPrimaryKeys
Parameters
convertCustomTypes: boolean = false
Returns null | (Entity extends { [PrimaryKeyProp]?: PK } ? PK extends keyof Entity<Entity> ? ReadonlyPrimary<UnwrapPrimary<Entity<Entity>[PK<PK>]>> : PK extends keyof Entity<Entity>[] ? ReadonlyPrimary<PrimaryPropToType<Entity<Entity>, PK<PK>>> : PK : Entity extends { _id?: PK } ? string | ReadonlyPrimary<PK> : Entity extends { uuid?: PK } ? ReadonlyPrimary<PK> : Entity extends { id?: PK } ? ReadonlyPrimary<PK> : Entity)[]
getSchema
Returns undefined | string
getSerializedPrimaryKey
Returns string
hasPrimaryKey
Returns boolean
init
Parameters
optionaloptions: FindOneOptions<Entity, Hint, Fields, Excludes>
Returns Promise<null | Loaded<Entity, Hint, Fields, Excludes>>
isInitialized
Returns boolean
isManaged
Returns boolean
isTouched
Returns boolean
populate
Parameters
populate: false | AutoPath<Entity, Hint, ALL>[]
options: EntityLoaderOptions<Entity> = {}
Returns Promise<Loaded<Entity, Hint>>
populated
Parameters
populated: undefined | boolean = true
Returns void
serialize
Parameters
optionaloptions: SerializeOptions<Entity, Hint, Exclude>
Returns EntityDTO<Loaded<Entity, Hint>>
setPrimaryKey
Parameters
id: null | (Entity extends { [PrimaryKeyProp]?: PK } ? PK extends keyof Entity<Entity> ? ReadonlyPrimary<UnwrapPrimary<Entity<Entity>[PK<PK>]>> : PK extends keyof Entity<Entity>[] ? ReadonlyPrimary<PrimaryPropToType<Entity<Entity>, PK<PK>>> : PK : Entity extends { _id?: PK } ? string | ReadonlyPrimary<PK> : Entity extends { uuid?: PK } ? ReadonlyPrimary<PK> : Entity extends { id?: PK } ? ReadonlyPrimary<PK> : Entity)
Returns void
setSchema
Parameters
optionalschema: string
Returns void
setSerializationContext
Parameters
options: LoadHint<Entity, Hint, Fields, Exclude>
Returns void
toJSON
Parameters
rest...args: any[]
Returns EntityDictionary<Entity>
toObject
Parameters
optionalignoreFields: Ignored[]
Returns Omit<EntityDTO<Entity>, Ignored>
toPOJO
Returns EntityDTO<Entity>
toReference
Returns Ref<Entity> & LoadedReference<Loaded<Entity, AddEager<Entity>>>
holds wrapped primary key, so we can compute change set without eager commit