@mikro-orm/core 7.0.0-dev.23 → 7.0.0-dev.231
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EntityManager.d.ts +91 -59
- package/EntityManager.js +303 -251
- package/MikroORM.d.ts +44 -35
- package/MikroORM.js +109 -143
- package/README.md +2 -0
- package/cache/FileCacheAdapter.d.ts +1 -1
- package/cache/FileCacheAdapter.js +17 -8
- package/cache/GeneratedCacheAdapter.d.ts +0 -1
- package/cache/GeneratedCacheAdapter.js +0 -2
- package/cache/index.d.ts +0 -1
- package/cache/index.js +0 -1
- package/connections/Connection.d.ts +12 -5
- package/connections/Connection.js +21 -12
- package/drivers/DatabaseDriver.d.ts +25 -16
- package/drivers/DatabaseDriver.js +118 -35
- package/drivers/IDatabaseDriver.d.ts +42 -19
- package/entity/BaseEntity.d.ts +61 -2
- package/entity/BaseEntity.js +0 -3
- package/entity/Collection.d.ts +101 -29
- package/entity/Collection.js +436 -104
- package/entity/EntityAssigner.d.ts +1 -1
- package/entity/EntityAssigner.js +26 -18
- package/entity/EntityFactory.d.ts +7 -1
- package/entity/EntityFactory.js +83 -54
- package/entity/EntityHelper.d.ts +2 -2
- package/entity/EntityHelper.js +48 -15
- package/entity/EntityLoader.d.ts +7 -6
- package/entity/EntityLoader.js +221 -93
- package/entity/EntityRepository.d.ts +27 -7
- package/entity/EntityRepository.js +8 -2
- package/entity/PolymorphicRef.d.ts +12 -0
- package/entity/PolymorphicRef.js +18 -0
- package/entity/Reference.d.ts +1 -5
- package/entity/Reference.js +21 -12
- package/entity/WrappedEntity.d.ts +0 -5
- package/entity/WrappedEntity.js +2 -7
- package/entity/defineEntity.d.ts +380 -310
- package/entity/defineEntity.js +124 -273
- package/entity/index.d.ts +2 -2
- package/entity/index.js +2 -2
- package/entity/utils.js +1 -1
- package/entity/validators.d.ts +11 -0
- package/entity/validators.js +65 -0
- package/enums.d.ts +8 -6
- package/enums.js +2 -1
- package/errors.d.ts +20 -10
- package/errors.js +55 -23
- package/events/EventManager.d.ts +2 -1
- package/events/EventManager.js +19 -11
- package/hydration/Hydrator.js +1 -2
- package/hydration/ObjectHydrator.d.ts +4 -4
- package/hydration/ObjectHydrator.js +87 -35
- package/index.d.ts +2 -2
- package/index.js +1 -2
- package/logging/DefaultLogger.d.ts +1 -1
- package/logging/DefaultLogger.js +1 -0
- package/logging/SimpleLogger.d.ts +1 -1
- package/logging/colors.d.ts +1 -1
- package/logging/colors.js +7 -6
- package/logging/index.d.ts +1 -0
- package/logging/index.js +1 -0
- package/logging/inspect.d.ts +2 -0
- package/logging/inspect.js +11 -0
- package/metadata/EntitySchema.d.ts +47 -23
- package/metadata/EntitySchema.js +92 -33
- package/metadata/MetadataDiscovery.d.ts +64 -9
- package/metadata/MetadataDiscovery.js +778 -325
- package/metadata/MetadataProvider.d.ts +11 -2
- package/metadata/MetadataProvider.js +46 -2
- package/metadata/MetadataStorage.d.ts +13 -11
- package/metadata/MetadataStorage.js +70 -37
- package/metadata/MetadataValidator.d.ts +32 -9
- package/metadata/MetadataValidator.js +196 -41
- package/metadata/discover-entities.d.ts +5 -0
- package/metadata/discover-entities.js +40 -0
- package/metadata/index.d.ts +1 -1
- package/metadata/index.js +1 -1
- package/metadata/types.d.ts +526 -0
- package/metadata/types.js +1 -0
- package/naming-strategy/AbstractNamingStrategy.d.ts +16 -4
- package/naming-strategy/AbstractNamingStrategy.js +20 -2
- package/naming-strategy/EntityCaseNamingStrategy.d.ts +3 -3
- package/naming-strategy/EntityCaseNamingStrategy.js +6 -5
- package/naming-strategy/MongoNamingStrategy.d.ts +3 -3
- package/naming-strategy/MongoNamingStrategy.js +6 -6
- package/naming-strategy/NamingStrategy.d.ts +28 -4
- package/naming-strategy/UnderscoreNamingStrategy.d.ts +3 -3
- package/naming-strategy/UnderscoreNamingStrategy.js +6 -6
- package/not-supported.d.ts +2 -0
- package/not-supported.js +4 -0
- package/package.json +19 -11
- package/platforms/ExceptionConverter.js +1 -1
- package/platforms/Platform.d.ts +7 -14
- package/platforms/Platform.js +20 -43
- package/serialization/EntitySerializer.d.ts +5 -0
- package/serialization/EntitySerializer.js +47 -27
- package/serialization/EntityTransformer.js +28 -18
- package/serialization/SerializationContext.d.ts +6 -6
- package/serialization/SerializationContext.js +3 -3
- package/types/ArrayType.d.ts +1 -1
- package/types/ArrayType.js +2 -3
- package/types/BigIntType.d.ts +8 -6
- package/types/BigIntType.js +1 -1
- package/types/BlobType.d.ts +0 -1
- package/types/BlobType.js +0 -3
- package/types/BooleanType.d.ts +1 -0
- package/types/BooleanType.js +3 -0
- package/types/DecimalType.d.ts +6 -4
- package/types/DecimalType.js +2 -2
- package/types/DoubleType.js +1 -1
- package/types/EnumArrayType.js +1 -2
- package/types/JsonType.d.ts +1 -1
- package/types/JsonType.js +7 -2
- package/types/TinyIntType.js +1 -1
- package/types/Type.d.ts +2 -4
- package/types/Type.js +3 -3
- package/types/Uint8ArrayType.d.ts +0 -1
- package/types/Uint8ArrayType.js +1 -4
- package/types/index.d.ts +1 -1
- package/typings.d.ts +381 -171
- package/typings.js +97 -44
- package/unit-of-work/ChangeSet.d.ts +4 -6
- package/unit-of-work/ChangeSet.js +4 -5
- package/unit-of-work/ChangeSetComputer.d.ts +1 -3
- package/unit-of-work/ChangeSetComputer.js +35 -14
- package/unit-of-work/ChangeSetPersister.d.ts +7 -3
- package/unit-of-work/ChangeSetPersister.js +83 -25
- package/unit-of-work/CommitOrderCalculator.d.ts +12 -10
- package/unit-of-work/CommitOrderCalculator.js +13 -13
- package/unit-of-work/IdentityMap.d.ts +12 -0
- package/unit-of-work/IdentityMap.js +39 -1
- package/unit-of-work/UnitOfWork.d.ts +27 -3
- package/unit-of-work/UnitOfWork.js +258 -92
- package/utils/AbstractSchemaGenerator.d.ts +5 -5
- package/utils/AbstractSchemaGenerator.js +28 -17
- package/utils/AsyncContext.d.ts +6 -0
- package/utils/AsyncContext.js +42 -0
- package/utils/Configuration.d.ts +795 -209
- package/utils/Configuration.js +150 -192
- package/utils/ConfigurationLoader.d.ts +1 -54
- package/utils/ConfigurationLoader.js +1 -352
- package/utils/Cursor.d.ts +0 -3
- package/utils/Cursor.js +24 -11
- package/utils/DataloaderUtils.d.ts +10 -5
- package/utils/DataloaderUtils.js +29 -12
- package/utils/EntityComparator.d.ts +16 -9
- package/utils/EntityComparator.js +158 -58
- package/utils/QueryHelper.d.ts +18 -6
- package/utils/QueryHelper.js +76 -23
- package/utils/RawQueryFragment.d.ts +28 -34
- package/utils/RawQueryFragment.js +35 -71
- package/utils/RequestContext.js +2 -2
- package/utils/TransactionContext.js +2 -2
- package/utils/TransactionManager.js +28 -4
- package/utils/Utils.d.ts +14 -127
- package/utils/Utils.js +85 -397
- package/utils/clone.js +8 -23
- package/utils/env-vars.d.ts +7 -0
- package/utils/env-vars.js +97 -0
- package/utils/fs-utils.d.ts +33 -0
- package/utils/fs-utils.js +192 -0
- package/utils/index.d.ts +1 -1
- package/utils/index.js +1 -1
- package/utils/upsert-utils.d.ts +9 -4
- package/utils/upsert-utils.js +46 -3
- package/decorators/Check.d.ts +0 -3
- package/decorators/Check.js +0 -13
- package/decorators/CreateRequestContext.d.ts +0 -3
- package/decorators/CreateRequestContext.js +0 -32
- package/decorators/Embeddable.d.ts +0 -8
- package/decorators/Embeddable.js +0 -11
- package/decorators/Embedded.d.ts +0 -12
- package/decorators/Embedded.js +0 -18
- package/decorators/Entity.d.ts +0 -33
- package/decorators/Entity.js +0 -12
- package/decorators/Enum.d.ts +0 -9
- package/decorators/Enum.js +0 -16
- package/decorators/Filter.d.ts +0 -2
- package/decorators/Filter.js +0 -8
- package/decorators/Formula.d.ts +0 -4
- package/decorators/Formula.js +0 -15
- package/decorators/Indexed.d.ts +0 -19
- package/decorators/Indexed.js +0 -20
- package/decorators/ManyToMany.d.ts +0 -42
- package/decorators/ManyToMany.js +0 -14
- package/decorators/ManyToOne.d.ts +0 -34
- package/decorators/ManyToOne.js +0 -14
- package/decorators/OneToMany.d.ts +0 -28
- package/decorators/OneToMany.js +0 -17
- package/decorators/OneToOne.d.ts +0 -28
- package/decorators/OneToOne.js +0 -7
- package/decorators/PrimaryKey.d.ts +0 -8
- package/decorators/PrimaryKey.js +0 -20
- package/decorators/Property.d.ts +0 -250
- package/decorators/Property.js +0 -32
- package/decorators/Transactional.d.ts +0 -14
- package/decorators/Transactional.js +0 -28
- package/decorators/hooks.d.ts +0 -16
- package/decorators/hooks.js +0 -47
- package/decorators/index.d.ts +0 -17
- package/decorators/index.js +0 -17
- package/entity/ArrayCollection.d.ts +0 -118
- package/entity/ArrayCollection.js +0 -407
- package/entity/EntityValidator.d.ts +0 -19
- package/entity/EntityValidator.js +0 -150
- package/metadata/ReflectMetadataProvider.d.ts +0 -8
- package/metadata/ReflectMetadataProvider.js +0 -44
- package/utils/resolveContextProvider.d.ts +0 -10
- package/utils/resolveContextProvider.js +0 -28
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrapper class for polymorphic relation reference data.
|
|
3
|
+
* Holds the discriminator value (type identifier) and the primary key value(s).
|
|
4
|
+
* Used internally to track polymorphic FK values before hydration.
|
|
5
|
+
*/
|
|
6
|
+
export declare class PolymorphicRef {
|
|
7
|
+
readonly discriminator: string;
|
|
8
|
+
id: unknown;
|
|
9
|
+
constructor(discriminator: string, id: unknown);
|
|
10
|
+
/** Returns `[discriminator, ...idValues]` tuple suitable for column-level expansion. */
|
|
11
|
+
toTuple(): unknown[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Utils } from '../utils/Utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Wrapper class for polymorphic relation reference data.
|
|
4
|
+
* Holds the discriminator value (type identifier) and the primary key value(s).
|
|
5
|
+
* Used internally to track polymorphic FK values before hydration.
|
|
6
|
+
*/
|
|
7
|
+
export class PolymorphicRef {
|
|
8
|
+
discriminator;
|
|
9
|
+
id;
|
|
10
|
+
constructor(discriminator, id) {
|
|
11
|
+
this.discriminator = discriminator;
|
|
12
|
+
this.id = id;
|
|
13
|
+
}
|
|
14
|
+
/** Returns `[discriminator, ...idValues]` tuple suitable for column-level expansion. */
|
|
15
|
+
toTuple() {
|
|
16
|
+
return [this.discriminator, ...Utils.asArray(this.id)];
|
|
17
|
+
}
|
|
18
|
+
}
|
package/entity/Reference.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { inspect } from 'node:util';
|
|
2
1
|
import type { AddEager, AddOptional, Dictionary, EntityClass, EntityKey, EntityProperty, Loaded, LoadedReference, Primary, Ref } from '../typings.js';
|
|
3
2
|
import type { FindOneOptions, FindOneOrFailOptions } from '../drivers/IDatabaseDriver.js';
|
|
4
3
|
export declare class Reference<T extends object> {
|
|
5
4
|
private entity;
|
|
5
|
+
private property?;
|
|
6
6
|
constructor(entity: T);
|
|
7
7
|
static create<T extends object>(entity: T | Ref<T>): Ref<T>;
|
|
8
8
|
static createFromPK<T extends object>(entityType: EntityClass<T>, pk: Primary<T>, options?: {
|
|
@@ -42,8 +42,6 @@ export declare class Reference<T extends object> {
|
|
|
42
42
|
isInitialized(): boolean;
|
|
43
43
|
populated(populated?: boolean): void;
|
|
44
44
|
toJSON(...args: any[]): Dictionary;
|
|
45
|
-
/** @ignore */
|
|
46
|
-
[inspect.custom](depth?: number): string;
|
|
47
45
|
}
|
|
48
46
|
export declare class ScalarReference<Value> {
|
|
49
47
|
private value?;
|
|
@@ -65,8 +63,6 @@ export declare class ScalarReference<Value> {
|
|
|
65
63
|
bind<Entity extends object>(entity: Entity, property: EntityKey<Entity>): void;
|
|
66
64
|
unwrap(): Value | undefined;
|
|
67
65
|
isInitialized(): boolean;
|
|
68
|
-
/** @ignore */
|
|
69
|
-
[inspect.custom](): string;
|
|
70
66
|
}
|
|
71
67
|
export interface LoadReferenceOptions<T extends object, P extends string = never, F extends string = '*', E extends string = never> extends FindOneOptions<T, P, F, E> {
|
|
72
68
|
dataloader?: boolean;
|
package/entity/Reference.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { inspect } from 'node:util';
|
|
2
1
|
import { DataloaderType } from '../enums.js';
|
|
3
2
|
import { helper, wrap } from './wrap.js';
|
|
4
3
|
import { Utils } from '../utils/Utils.js';
|
|
4
|
+
import { QueryHelper } from '../utils/QueryHelper.js';
|
|
5
5
|
import { NotFoundError } from '../errors.js';
|
|
6
|
+
import { inspect } from '../logging/inspect.js';
|
|
6
7
|
export class Reference {
|
|
7
8
|
entity;
|
|
9
|
+
property;
|
|
8
10
|
constructor(entity) {
|
|
9
11
|
this.entity = entity;
|
|
10
12
|
this.set(entity);
|
|
@@ -34,10 +36,15 @@ export class Reference {
|
|
|
34
36
|
}
|
|
35
37
|
static createFromPK(entityType, pk, options) {
|
|
36
38
|
const ref = this.createNakedFromPK(entityType, pk, options);
|
|
37
|
-
return helper(ref)
|
|
39
|
+
return helper(ref)?.toReference() ?? ref;
|
|
38
40
|
}
|
|
39
41
|
static createNakedFromPK(entityType, pk, options) {
|
|
40
42
|
const factory = entityType.prototype.__factory;
|
|
43
|
+
if (!factory) {
|
|
44
|
+
// this can happen only if `ref()` is used as a property initializer, and the value is important only for the
|
|
45
|
+
// inference of defaults, so it's fine to return it directly without wrapping with `Reference` class
|
|
46
|
+
return pk;
|
|
47
|
+
}
|
|
41
48
|
const entity = factory.createReference(entityType, pk, {
|
|
42
49
|
merge: false,
|
|
43
50
|
convertCustomTypes: false,
|
|
@@ -59,7 +66,9 @@ export class Reference {
|
|
|
59
66
|
*/
|
|
60
67
|
static wrapReference(entity, prop) {
|
|
61
68
|
if (entity && prop.ref && !Reference.isReference(entity)) {
|
|
62
|
-
|
|
69
|
+
const ref = Reference.create(entity);
|
|
70
|
+
ref.property = prop;
|
|
71
|
+
return ref;
|
|
63
72
|
}
|
|
64
73
|
return entity;
|
|
65
74
|
}
|
|
@@ -79,13 +88,14 @@ export class Reference {
|
|
|
79
88
|
if (!wrapped.__em) {
|
|
80
89
|
return this.entity;
|
|
81
90
|
}
|
|
91
|
+
options = { ...options, filters: QueryHelper.mergePropertyFilters(this.property?.filters, options.filters) };
|
|
82
92
|
if (this.isInitialized() && !options.refresh && options.populate) {
|
|
83
93
|
await wrapped.__em.populate(this.entity, options.populate, options);
|
|
84
94
|
}
|
|
85
95
|
if (!this.isInitialized() || options.refresh) {
|
|
86
96
|
if (options.dataloader ?? [DataloaderType.ALL, DataloaderType.REFERENCE].includes(wrapped.__em.config.getDataloaderType())) {
|
|
87
|
-
|
|
88
|
-
return
|
|
97
|
+
const dataLoader = await wrapped.__em.getDataLoader('ref');
|
|
98
|
+
return dataLoader.load([this, options]);
|
|
89
99
|
}
|
|
90
100
|
return wrapped.init(options);
|
|
91
101
|
}
|
|
@@ -136,9 +146,9 @@ export class Reference {
|
|
|
136
146
|
return wrap(this.entity).toJSON(...args);
|
|
137
147
|
}
|
|
138
148
|
/** @ignore */
|
|
139
|
-
[inspect.custom](depth = 2) {
|
|
149
|
+
[Symbol.for('nodejs.util.inspect.custom')](depth = 2) {
|
|
140
150
|
const object = { ...this };
|
|
141
|
-
const hidden = ['meta'];
|
|
151
|
+
const hidden = ['meta', 'property'];
|
|
142
152
|
hidden.forEach(k => delete object[k]);
|
|
143
153
|
const ret = inspect(object, { depth });
|
|
144
154
|
const wrapped = helper(this.entity);
|
|
@@ -178,12 +188,11 @@ export class ScalarReference {
|
|
|
178
188
|
*/
|
|
179
189
|
async loadOrFail(options = {}) {
|
|
180
190
|
const ret = await this.load(options);
|
|
181
|
-
if (
|
|
191
|
+
if (ret == null) {
|
|
182
192
|
const wrapped = helper(this.entity);
|
|
183
193
|
options.failHandler ??= wrapped.__em.config.get('findOneOrFailHandler');
|
|
184
194
|
const entityName = this.entity.constructor.name;
|
|
185
|
-
|
|
186
|
-
throw new NotFoundError(`${entityName} (${where}) failed to load property '${this.property}'`);
|
|
195
|
+
throw NotFoundError.failedToLoadProperty(entityName, this.property, wrapped.getPrimaryKey());
|
|
187
196
|
}
|
|
188
197
|
return ret;
|
|
189
198
|
}
|
|
@@ -202,9 +211,9 @@ export class ScalarReference {
|
|
|
202
211
|
isInitialized() {
|
|
203
212
|
return this.initialized;
|
|
204
213
|
}
|
|
205
|
-
/* v8 ignore next 4 */
|
|
206
214
|
/** @ignore */
|
|
207
|
-
|
|
215
|
+
/* v8 ignore next */
|
|
216
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
208
217
|
return this.initialized ? `Ref<${inspect(this.value)}>` : `Ref<?>`;
|
|
209
218
|
}
|
|
210
219
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { PopulatePath } from '../enums.js';
|
|
2
|
-
import { inspect } from 'node:util';
|
|
3
2
|
import type { EntityManager } from '../EntityManager.js';
|
|
4
3
|
import type { Dictionary, EntityData, EntityDictionary, EntityMetadata, IHydrator, EntityKey, PopulateOptions, Primary, AutoPath, Ref, AddEager, LoadedReference, EntityDTO, Loaded, FromEntityType, IsSubset, MergeSelected } from '../typings.js';
|
|
5
4
|
import { Reference } from './Reference.js';
|
|
@@ -11,7 +10,6 @@ import { type SerializeOptions } from '../serialization/EntitySerializer.js';
|
|
|
11
10
|
import type { FindOneOptions, LoadHint } from '../drivers/IDatabaseDriver.js';
|
|
12
11
|
export declare class WrappedEntity<Entity extends object> {
|
|
13
12
|
__initialized: boolean;
|
|
14
|
-
__touched: boolean;
|
|
15
13
|
__populated?: boolean;
|
|
16
14
|
__managed?: boolean;
|
|
17
15
|
__onLoadFired?: boolean;
|
|
@@ -41,7 +39,6 @@ export declare class WrappedEntity<Entity extends object> {
|
|
|
41
39
|
private readonly pkGetterConverted?;
|
|
42
40
|
constructor(entity: Entity, hydrator: IHydrator, pkGetter?: (e: Entity) => Primary<Entity>, pkSerializer?: (e: Entity) => string, pkGetterConverted?: (e: Entity) => Primary<Entity>);
|
|
43
41
|
isInitialized(): boolean;
|
|
44
|
-
isTouched(): boolean;
|
|
45
42
|
isManaged(): boolean;
|
|
46
43
|
populated(populated?: boolean | undefined): void;
|
|
47
44
|
setSerializationContext<Hint extends string = never, Fields extends string = '*', Exclude extends string = never>(options: LoadHint<Entity, Hint, Fields, Exclude>): void;
|
|
@@ -64,6 +61,4 @@ export declare class WrappedEntity<Entity extends object> {
|
|
|
64
61
|
get __platform(): import("../index.js").Platform;
|
|
65
62
|
get __config(): import("../index.js").Configuration<import("../drivers/IDatabaseDriver.js").IDatabaseDriver<import("../index.js").Connection>, EntityManager<import("../drivers/IDatabaseDriver.js").IDatabaseDriver<import("../index.js").Connection>>>;
|
|
66
63
|
get __primaryKeys(): Primary<Entity>[];
|
|
67
|
-
/** @ignore */
|
|
68
|
-
[inspect.custom](): string;
|
|
69
64
|
}
|
package/entity/WrappedEntity.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { inspect } from 'node:util';
|
|
2
1
|
import { Reference } from './Reference.js';
|
|
3
2
|
import { EntityTransformer } from '../serialization/EntityTransformer.js';
|
|
4
3
|
import { EntityAssigner } from './EntityAssigner.js';
|
|
@@ -15,7 +14,6 @@ export class WrappedEntity {
|
|
|
15
14
|
this.pkSerializer = pkSerializer;
|
|
16
15
|
this.pkGetterConverted = pkGetterConverted;
|
|
17
16
|
this.__initialized = true;
|
|
18
|
-
this.__touched = false;
|
|
19
17
|
this.__serializationContext = {};
|
|
20
18
|
this.__loadedProperties = new Set();
|
|
21
19
|
this.__data = {};
|
|
@@ -24,9 +22,6 @@ export class WrappedEntity {
|
|
|
24
22
|
isInitialized() {
|
|
25
23
|
return this.__initialized;
|
|
26
24
|
}
|
|
27
|
-
isTouched() {
|
|
28
|
-
return this.__touched;
|
|
29
|
-
}
|
|
30
25
|
isManaged() {
|
|
31
26
|
return !!this.__managed;
|
|
32
27
|
}
|
|
@@ -76,7 +71,7 @@ export class WrappedEntity {
|
|
|
76
71
|
if (!this.__em) {
|
|
77
72
|
throw ValidationError.entityNotManaged(this.entity);
|
|
78
73
|
}
|
|
79
|
-
return this.__em.findOne(this.entity.constructor
|
|
74
|
+
return this.__em.findOne(this.entity.constructor, this.entity, { ...options, refresh: true, schema: this.__schema });
|
|
80
75
|
}
|
|
81
76
|
async populate(populate, options = {}) {
|
|
82
77
|
if (!this.__em) {
|
|
@@ -153,7 +148,7 @@ export class WrappedEntity {
|
|
|
153
148
|
return Utils.getPrimaryKeyValues(this.entity, this.__meta);
|
|
154
149
|
}
|
|
155
150
|
/** @ignore */
|
|
156
|
-
[inspect.custom]() {
|
|
151
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
157
152
|
return `[WrappedEntity<${this.__meta.className}>]`;
|
|
158
153
|
}
|
|
159
154
|
}
|