abstractBaseEntity
Index
Constructors
constructor
Returns BaseEntity
Methods
assign
Parameters
data: Data & IsSubset<EntityData<Naked>, Data>
options: AssignOptions<Convert> = {}
Returns MergeSelected<Entity, Naked, keyof Data & string>
getSchema
Returns undefined | string
init
Parameters
optionaloptions: FindOneOptions<Entity, Hint, Fields, Excludes>
Returns Promise<null | Loaded<Entity, Hint, Fields, Excludes>>
isInitialized
Returns boolean
populate
Parameters
populate: false | AutoPath<Entity, Hint, ALL, 9>[]
options: EntityLoaderOptions<Entity, Fields, never> = {}
Returns Promise<Loaded<Entity, Hint>>
populated
Parameters
populated: boolean = true
Returns void
serialize
Parameters
optionaloptions: SerializeOptions<Naked, Hint, Exclude>
Returns SerializeDTO<Naked, Hint, Exclude, never>
setSchema
Parameters
optionalschema: string
Returns void
toObject
Returns EntityDTO<Entity>
toPOJO
Returns EntityDTO<Entity>
toReference
Returns Reference<Entity> & LoadedReference<Loaded<Entity, AddEager<Entity>>>
Converts the entity to a plain object representation.
Note on typing with
Loadedentities: When called on aLoaded<Entity, 'relation'>type, the return type will beEntityDTO<Entity>(with relations as primary keys), notEntityDTO<Loaded<Entity, 'relation'>>(with loaded relations as nested objects). This is a TypeScript limitation - thethistype resolves to the class, not theLoadedwrapper.For correct typing that reflects loaded relations, use
wrap():Runtime values are correct in both cases - only the static types differ.