@mikro-orm/core 7.0.0-dev.1 → 7.0.0-dev.11
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 +25 -16
- package/EntityManager.js +219 -209
- package/MikroORM.d.ts +7 -6
- package/MikroORM.js +33 -45
- package/cache/CacheAdapter.js +1 -2
- package/cache/FileCacheAdapter.d.ts +1 -1
- package/cache/FileCacheAdapter.js +18 -26
- package/cache/GeneratedCacheAdapter.d.ts +2 -2
- package/cache/GeneratedCacheAdapter.js +1 -5
- package/cache/MemoryCacheAdapter.d.ts +1 -1
- package/cache/MemoryCacheAdapter.js +1 -5
- package/cache/NullCacheAdapter.d.ts +1 -1
- package/cache/NullCacheAdapter.js +1 -5
- package/cache/index.d.ts +5 -5
- package/cache/index.js +5 -21
- package/connections/Connection.d.ts +7 -7
- package/connections/Connection.js +8 -12
- package/connections/index.d.ts +1 -1
- package/connections/index.js +1 -17
- package/decorators/Check.d.ts +2 -2
- package/decorators/Check.js +5 -8
- package/decorators/CreateRequestContext.d.ts +1 -1
- package/decorators/CreateRequestContext.js +13 -14
- package/decorators/Embeddable.d.ts +5 -5
- package/decorators/Embeddable.js +4 -7
- package/decorators/Embedded.d.ts +3 -3
- package/decorators/Embedded.js +10 -12
- package/decorators/Entity.d.ts +6 -6
- package/decorators/Entity.js +5 -9
- package/decorators/Enum.d.ts +3 -3
- package/decorators/Enum.js +7 -10
- package/decorators/Filter.d.ts +1 -1
- package/decorators/Filter.js +3 -6
- package/decorators/Formula.d.ts +2 -3
- package/decorators/Formula.js +7 -10
- package/decorators/Indexed.d.ts +10 -8
- package/decorators/Indexed.js +7 -11
- package/decorators/ManyToMany.d.ts +4 -4
- package/decorators/ManyToMany.js +10 -12
- package/decorators/ManyToOne.d.ts +4 -4
- package/decorators/ManyToOne.js +10 -12
- package/decorators/OneToMany.d.ts +6 -6
- package/decorators/OneToMany.js +11 -14
- package/decorators/OneToOne.d.ts +4 -4
- package/decorators/OneToOne.js +4 -7
- package/decorators/PrimaryKey.d.ts +3 -4
- package/decorators/PrimaryKey.js +10 -13
- package/decorators/Property.d.ts +6 -6
- package/decorators/Property.js +10 -12
- package/decorators/Transactional.d.ts +2 -2
- package/decorators/Transactional.js +7 -10
- package/decorators/hooks.js +23 -35
- package/decorators/index.d.ts +17 -17
- package/decorators/index.js +17 -36
- package/drivers/DatabaseDriver.d.ts +13 -12
- package/drivers/DatabaseDriver.js +60 -64
- package/drivers/IDatabaseDriver.d.ts +16 -13
- package/drivers/IDatabaseDriver.js +1 -4
- package/drivers/index.d.ts +2 -2
- package/drivers/index.js +2 -18
- package/entity/ArrayCollection.d.ts +3 -3
- package/entity/ArrayCollection.js +38 -35
- package/entity/BaseEntity.d.ts +6 -6
- package/entity/BaseEntity.js +17 -21
- package/entity/Collection.d.ts +6 -7
- package/entity/Collection.js +47 -51
- package/entity/EntityAssigner.d.ts +2 -2
- package/entity/EntityAssigner.js +58 -63
- package/entity/EntityFactory.d.ts +3 -3
- package/entity/EntityFactory.js +62 -63
- package/entity/EntityHelper.d.ts +2 -2
- package/entity/EntityHelper.js +44 -45
- package/entity/EntityIdentifier.d.ts +1 -1
- package/entity/EntityIdentifier.js +1 -5
- package/entity/EntityLoader.d.ts +5 -5
- package/entity/EntityLoader.js +106 -98
- package/entity/EntityRepository.d.ts +7 -7
- package/entity/EntityRepository.js +7 -11
- package/entity/EntityValidator.d.ts +1 -1
- package/entity/EntityValidator.js +25 -29
- package/entity/Reference.d.ts +4 -8
- package/entity/Reference.js +35 -42
- package/entity/WrappedEntity.d.ts +12 -12
- package/entity/WrappedEntity.js +23 -27
- package/entity/index.d.ts +13 -13
- package/entity/index.js +13 -29
- package/entity/utils.d.ts +1 -1
- package/entity/utils.js +9 -12
- package/entity/wrap.d.ts +1 -1
- package/entity/wrap.js +2 -6
- package/enums.d.ts +3 -3
- package/enums.js +37 -41
- package/errors.d.ts +1 -1
- package/errors.js +15 -24
- package/events/EventManager.d.ts +3 -3
- package/events/EventManager.js +8 -12
- package/events/EventSubscriber.d.ts +8 -5
- package/events/EventSubscriber.js +1 -2
- package/events/TransactionEventBroadcaster.d.ts +3 -3
- package/events/TransactionEventBroadcaster.js +1 -5
- package/events/index.d.ts +3 -3
- package/events/index.js +3 -19
- package/exceptions.js +18 -39
- package/hydration/Hydrator.d.ts +5 -5
- package/hydration/Hydrator.js +3 -6
- package/hydration/ObjectHydrator.d.ts +3 -3
- package/hydration/ObjectHydrator.js +26 -28
- package/hydration/index.d.ts +2 -2
- package/hydration/index.js +2 -18
- package/index.d.ts +21 -21
- package/index.js +21 -46
- package/logging/DefaultLogger.d.ts +1 -1
- package/logging/DefaultLogger.js +9 -13
- package/logging/Logger.d.ts +1 -1
- package/logging/Logger.js +1 -2
- package/logging/SimpleLogger.d.ts +2 -2
- package/logging/SimpleLogger.js +2 -6
- package/logging/colors.js +1 -5
- package/logging/index.d.ts +4 -4
- package/logging/index.js +4 -20
- package/metadata/EntitySchema.d.ts +14 -6
- package/metadata/EntitySchema.js +41 -45
- package/metadata/MetadataDiscovery.d.ts +7 -7
- package/metadata/MetadataDiscovery.js +181 -180
- package/metadata/MetadataProvider.d.ts +2 -2
- package/metadata/MetadataProvider.js +4 -7
- package/metadata/MetadataStorage.d.ts +2 -2
- package/metadata/MetadataStorage.js +15 -19
- package/metadata/MetadataValidator.d.ts +4 -4
- package/metadata/MetadataValidator.js +52 -55
- package/metadata/ReflectMetadataProvider.d.ts +2 -2
- package/metadata/ReflectMetadataProvider.js +8 -12
- package/metadata/index.d.ts +6 -6
- package/metadata/index.js +6 -22
- package/naming-strategy/AbstractNamingStrategy.d.ts +2 -2
- package/naming-strategy/AbstractNamingStrategy.js +4 -8
- package/naming-strategy/EntityCaseNamingStrategy.d.ts +1 -1
- package/naming-strategy/EntityCaseNamingStrategy.js +2 -6
- package/naming-strategy/MongoNamingStrategy.d.ts +1 -1
- package/naming-strategy/MongoNamingStrategy.js +2 -6
- package/naming-strategy/NamingStrategy.d.ts +1 -1
- package/naming-strategy/NamingStrategy.js +1 -2
- package/naming-strategy/UnderscoreNamingStrategy.d.ts +1 -1
- package/naming-strategy/UnderscoreNamingStrategy.js +2 -6
- package/naming-strategy/index.d.ts +5 -5
- package/naming-strategy/index.js +5 -21
- package/package.json +6 -15
- package/platforms/ExceptionConverter.d.ts +2 -2
- package/platforms/ExceptionConverter.js +4 -8
- package/platforms/Platform.d.ts +10 -10
- package/platforms/Platform.js +57 -61
- package/platforms/index.d.ts +2 -2
- package/platforms/index.js +2 -18
- package/serialization/EntitySerializer.d.ts +2 -2
- package/serialization/EntitySerializer.js +36 -41
- package/serialization/EntityTransformer.d.ts +1 -1
- package/serialization/EntityTransformer.js +27 -31
- package/serialization/SerializationContext.d.ts +2 -2
- package/serialization/SerializationContext.js +10 -14
- package/serialization/index.d.ts +3 -3
- package/serialization/index.js +3 -19
- package/types/ArrayType.d.ts +3 -3
- package/types/ArrayType.js +7 -11
- package/types/BigIntType.d.ts +4 -3
- package/types/BigIntType.js +6 -6
- package/types/BlobType.d.ts +3 -3
- package/types/BlobType.js +2 -8
- package/types/BooleanType.d.ts +3 -3
- package/types/BooleanType.js +2 -6
- package/types/CharacterType.d.ts +3 -3
- package/types/CharacterType.js +2 -6
- package/types/DateTimeType.d.ts +3 -3
- package/types/DateTimeType.js +2 -6
- package/types/DateType.d.ts +3 -3
- package/types/DateType.js +2 -6
- package/types/DecimalType.d.ts +3 -3
- package/types/DecimalType.js +4 -7
- package/types/DoubleType.d.ts +3 -3
- package/types/DoubleType.js +3 -6
- package/types/EnumArrayType.d.ts +4 -4
- package/types/EnumArrayType.js +5 -10
- package/types/EnumType.d.ts +3 -3
- package/types/EnumType.js +2 -6
- package/types/FloatType.d.ts +3 -3
- package/types/FloatType.js +2 -6
- package/types/IntegerType.d.ts +3 -3
- package/types/IntegerType.js +2 -6
- package/types/IntervalType.d.ts +3 -3
- package/types/IntervalType.js +2 -6
- package/types/JsonType.d.ts +3 -3
- package/types/JsonType.js +2 -6
- package/types/MediumIntType.d.ts +3 -3
- package/types/MediumIntType.js +2 -6
- package/types/SmallIntType.d.ts +3 -3
- package/types/SmallIntType.js +2 -6
- package/types/StringType.d.ts +3 -3
- package/types/StringType.js +2 -6
- package/types/TextType.d.ts +3 -3
- package/types/TextType.js +2 -6
- package/types/TimeType.d.ts +3 -3
- package/types/TimeType.js +4 -8
- package/types/TinyIntType.d.ts +3 -3
- package/types/TinyIntType.js +3 -6
- package/types/Type.d.ts +2 -2
- package/types/Type.js +5 -9
- package/types/Uint8ArrayType.d.ts +3 -3
- package/types/Uint8ArrayType.js +3 -9
- package/types/UnknownType.d.ts +3 -3
- package/types/UnknownType.js +2 -6
- package/types/UuidType.d.ts +3 -3
- package/types/UuidType.js +2 -6
- package/types/index.d.ts +25 -25
- package/types/index.js +52 -79
- package/typings.d.ts +33 -28
- package/typings.js +37 -38
- package/unit-of-work/ChangeSet.d.ts +1 -1
- package/unit-of-work/ChangeSet.js +13 -17
- package/unit-of-work/ChangeSetComputer.d.ts +8 -7
- package/unit-of-work/ChangeSetComputer.js +26 -30
- package/unit-of-work/ChangeSetPersister.d.ts +7 -6
- package/unit-of-work/ChangeSetPersister.js +51 -48
- package/unit-of-work/CommitOrderCalculator.d.ts +1 -1
- package/unit-of-work/CommitOrderCalculator.js +6 -10
- package/unit-of-work/IdentityMap.d.ts +1 -1
- package/unit-of-work/IdentityMap.js +1 -5
- package/unit-of-work/UnitOfWork.d.ts +8 -7
- package/unit-of-work/UnitOfWork.js +193 -178
- package/unit-of-work/index.d.ts +6 -6
- package/unit-of-work/index.js +6 -22
- package/utils/AbstractSchemaGenerator.d.ts +6 -6
- package/utils/AbstractSchemaGenerator.js +12 -13
- package/utils/Configuration.d.ts +26 -27
- package/utils/Configuration.js +50 -55
- package/utils/ConfigurationLoader.d.ts +9 -8
- package/utils/ConfigurationLoader.js +71 -86
- package/utils/Cursor.d.ts +6 -6
- package/utils/Cursor.js +22 -25
- package/utils/DataloaderUtils.d.ts +4 -4
- package/utils/DataloaderUtils.js +12 -16
- package/utils/EntityComparator.d.ts +2 -2
- package/utils/EntityComparator.js +109 -97
- package/utils/NullHighlighter.d.ts +1 -1
- package/utils/NullHighlighter.js +1 -5
- package/utils/QueryHelper.d.ts +3 -3
- package/utils/QueryHelper.js +47 -51
- package/utils/RawQueryFragment.d.ts +1 -1
- package/utils/RawQueryFragment.js +22 -25
- package/utils/RequestContext.d.ts +2 -2
- package/utils/RequestContext.js +3 -7
- package/utils/TransactionContext.d.ts +1 -1
- package/utils/TransactionContext.js +4 -8
- package/utils/Utils.d.ts +16 -12
- package/utils/Utils.js +96 -95
- package/utils/clone.js +8 -11
- package/utils/index.d.ts +13 -13
- package/utils/index.js +13 -29
- package/utils/resolveContextProvider.d.ts +3 -3
- package/utils/resolveContextProvider.js +9 -12
- package/utils/upsert-utils.d.ts +3 -3
- package/utils/upsert-utils.js +5 -9
- package/index.mjs +0 -199
package/entity/EntityHelper.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const WrappedEntity_1 = require("./WrappedEntity");
|
|
10
|
-
const enums_1 = require("../enums");
|
|
11
|
-
const wrap_1 = require("./wrap");
|
|
1
|
+
import { inspect } from 'node:util';
|
|
2
|
+
import { EagerProps, EntityRepositoryType, HiddenProps, OptionalProps, PrimaryKeyProp, } from '../typings.js';
|
|
3
|
+
import { EntityTransformer } from '../serialization/EntityTransformer.js';
|
|
4
|
+
import { Reference } from './Reference.js';
|
|
5
|
+
import { Utils } from '../utils/Utils.js';
|
|
6
|
+
import { WrappedEntity } from './WrappedEntity.js';
|
|
7
|
+
import { ReferenceKind } from '../enums.js';
|
|
8
|
+
import { helper } from './wrap.js';
|
|
12
9
|
/**
|
|
13
10
|
* @internal
|
|
14
11
|
*/
|
|
15
|
-
class EntityHelper {
|
|
12
|
+
export class EntityHelper {
|
|
16
13
|
static decorate(meta, em) {
|
|
17
14
|
const fork = em.fork(); // use fork so we can access `EntityFactory`
|
|
18
15
|
const serializedPrimaryKey = meta.props.find(p => p.serializedPrimaryKey);
|
|
@@ -35,7 +32,7 @@ class EntityHelper {
|
|
|
35
32
|
const prototype = meta.prototype;
|
|
36
33
|
if (!prototype.toJSON) { // toJSON can be overridden
|
|
37
34
|
prototype.toJSON = function (...args) {
|
|
38
|
-
return
|
|
35
|
+
return EntityTransformer.toObject(this, ...args.slice(meta.toJsonParams.length));
|
|
39
36
|
};
|
|
40
37
|
}
|
|
41
38
|
}
|
|
@@ -56,7 +53,7 @@ class EntityHelper {
|
|
|
56
53
|
__helper: {
|
|
57
54
|
get() {
|
|
58
55
|
Object.defineProperty(this, '__helper', {
|
|
59
|
-
value: new
|
|
56
|
+
value: new WrappedEntity(this, em.getHydrator(), ...helperParams),
|
|
60
57
|
enumerable: false,
|
|
61
58
|
configurable: true,
|
|
62
59
|
});
|
|
@@ -78,8 +75,8 @@ class EntityHelper {
|
|
|
78
75
|
Object
|
|
79
76
|
.values(meta.properties)
|
|
80
77
|
.forEach(prop => {
|
|
81
|
-
const isCollection = [
|
|
82
|
-
const isReference = [
|
|
78
|
+
const isCollection = [ReferenceKind.ONE_TO_MANY, ReferenceKind.MANY_TO_MANY].includes(prop.kind);
|
|
79
|
+
const isReference = [ReferenceKind.ONE_TO_ONE, ReferenceKind.MANY_TO_ONE].includes(prop.kind) && (prop.inversedBy || prop.mappedBy) && !prop.mapToPk;
|
|
83
80
|
if (isReference) {
|
|
84
81
|
Object.defineProperty(meta.prototype, prop.name, {
|
|
85
82
|
set(val) {
|
|
@@ -115,49 +112,52 @@ class EntityHelper {
|
|
|
115
112
|
}
|
|
116
113
|
static defineCustomInspect(meta) {
|
|
117
114
|
// @ts-ignore
|
|
118
|
-
meta.prototype[
|
|
115
|
+
meta.prototype[inspect.custom] ??= function (depth = 2) {
|
|
119
116
|
const object = { ...this };
|
|
120
117
|
// ensure we dont have internal symbols in the POJO
|
|
121
|
-
[
|
|
118
|
+
[OptionalProps, EntityRepositoryType, PrimaryKeyProp, EagerProps, HiddenProps].forEach(sym => delete object[sym]);
|
|
122
119
|
meta.props
|
|
123
120
|
.filter(prop => object[prop.name] === undefined)
|
|
124
121
|
.forEach(prop => delete object[prop.name]);
|
|
125
|
-
const ret =
|
|
122
|
+
const ret = inspect(object, { depth });
|
|
126
123
|
let name = (this).constructor.name;
|
|
127
124
|
const showEM = ['true', 't', '1'].includes(process.env.MIKRO_ORM_LOG_EM_ID?.toString().toLowerCase() ?? '');
|
|
128
125
|
if (showEM) {
|
|
129
|
-
if (
|
|
130
|
-
name += ` [managed by ${
|
|
126
|
+
if (helper(this).__em) {
|
|
127
|
+
name += ` [managed by ${helper(this).__em.id}]`;
|
|
131
128
|
}
|
|
132
129
|
else {
|
|
133
130
|
name += ` [not managed]`;
|
|
134
131
|
}
|
|
135
132
|
}
|
|
136
133
|
// distinguish not initialized entities
|
|
137
|
-
if (!
|
|
134
|
+
if (!helper(this).__initialized) {
|
|
138
135
|
name = `(${name})`;
|
|
139
136
|
}
|
|
140
137
|
return ret === '[Object]' ? `[${name}]` : name + ' ' + ret;
|
|
141
138
|
};
|
|
142
139
|
}
|
|
143
140
|
static defineReferenceProperty(meta, prop, ref, hydrator) {
|
|
144
|
-
const wrapped =
|
|
141
|
+
const wrapped = helper(ref);
|
|
145
142
|
Object.defineProperty(ref, prop.name, {
|
|
146
143
|
get() {
|
|
147
|
-
return
|
|
144
|
+
return helper(ref).__data[prop.name];
|
|
148
145
|
},
|
|
149
146
|
set(val) {
|
|
150
|
-
const entity =
|
|
151
|
-
const old =
|
|
152
|
-
|
|
147
|
+
const entity = Reference.unwrapReference(val ?? wrapped.__data[prop.name]);
|
|
148
|
+
const old = Reference.unwrapReference(wrapped.__data[prop.name]);
|
|
149
|
+
if (old && old !== entity && prop.kind === ReferenceKind.MANY_TO_ONE && prop.inversedBy && old[prop.inversedBy]) {
|
|
150
|
+
old[prop.inversedBy].removeWithoutPropagation(this);
|
|
151
|
+
}
|
|
152
|
+
wrapped.__data[prop.name] = Reference.wrapReference(val, prop);
|
|
153
153
|
// when propagation from inside hydration, we set the FK to the entity data immediately
|
|
154
154
|
if (val && hydrator.isRunning() && wrapped.__originalEntityData && prop.owner) {
|
|
155
|
-
wrapped.__originalEntityData[prop.name] =
|
|
155
|
+
wrapped.__originalEntityData[prop.name] = Utils.getPrimaryKeyValues(wrapped.__data[prop.name], prop.targetMeta.primaryKeys, true);
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
158
158
|
wrapped.__touched = !hydrator.isRunning();
|
|
159
159
|
}
|
|
160
|
-
EntityHelper.propagate(meta, entity, this, prop,
|
|
160
|
+
EntityHelper.propagate(meta, entity, this, prop, Reference.unwrapReference(val), old);
|
|
161
161
|
},
|
|
162
162
|
enumerable: true,
|
|
163
163
|
configurable: true,
|
|
@@ -172,51 +172,51 @@ class EntityHelper {
|
|
|
172
172
|
continue;
|
|
173
173
|
}
|
|
174
174
|
const inverse = value?.[prop2.name];
|
|
175
|
-
if (prop.kind ===
|
|
175
|
+
if (prop.kind === ReferenceKind.MANY_TO_ONE && Utils.isCollection(inverse) && inverse.isInitialized()) {
|
|
176
176
|
inverse.addWithoutPropagation(owner);
|
|
177
|
-
|
|
177
|
+
helper(owner).__em?.getUnitOfWork().cancelOrphanRemoval(owner);
|
|
178
178
|
}
|
|
179
|
-
if (prop.kind ===
|
|
180
|
-
if ((value != null &&
|
|
179
|
+
if (prop.kind === ReferenceKind.ONE_TO_ONE) {
|
|
180
|
+
if ((value != null && Reference.unwrapReference(inverse) !== owner) ||
|
|
181
181
|
(value == null && entity?.[prop2.name] != null)) {
|
|
182
|
-
if (entity && (!prop.owner ||
|
|
182
|
+
if (entity && (!prop.owner || helper(entity).__initialized)) {
|
|
183
183
|
EntityHelper.propagateOneToOne(entity, owner, prop, prop2, value, old);
|
|
184
184
|
}
|
|
185
185
|
if (old && prop.orphanRemoval) {
|
|
186
|
-
|
|
186
|
+
helper(old).__em?.getUnitOfWork().scheduleOrphanRemoval(old);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
static propagateOneToOne(entity, owner, prop, prop2, value, old) {
|
|
193
|
-
|
|
193
|
+
helper(entity).__pk = helper(entity).getPrimaryKey();
|
|
194
194
|
// the inverse side will be changed on the `value` too, so we need to clean-up and schedule orphan removal there too
|
|
195
|
-
if (!prop.primary && !prop2.mapToPk && value?.[prop2.name] != null &&
|
|
196
|
-
const other =
|
|
197
|
-
delete
|
|
195
|
+
if (!prop.primary && !prop2.mapToPk && value?.[prop2.name] != null && Reference.unwrapReference(value[prop2.name]) !== entity) {
|
|
196
|
+
const other = Reference.unwrapReference(value[prop2.name]);
|
|
197
|
+
delete helper(other).__data[prop.name];
|
|
198
198
|
if (prop2.orphanRemoval) {
|
|
199
|
-
|
|
199
|
+
helper(other).__em?.getUnitOfWork().scheduleOrphanRemoval(other);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
if (value == null) {
|
|
203
203
|
entity[prop2.name] = value;
|
|
204
204
|
}
|
|
205
205
|
else if (prop2.mapToPk) {
|
|
206
|
-
entity[prop2.name] =
|
|
206
|
+
entity[prop2.name] = helper(owner).getPrimaryKey();
|
|
207
207
|
}
|
|
208
208
|
else {
|
|
209
|
-
entity[prop2.name] =
|
|
209
|
+
entity[prop2.name] = Reference.wrapReference(owner, prop);
|
|
210
210
|
}
|
|
211
211
|
if (old?.[prop2.name] != null) {
|
|
212
|
-
delete
|
|
212
|
+
delete helper(old).__data[prop2.name];
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
static ensurePropagation(entity) {
|
|
216
216
|
if (entity.__gettersDefined) {
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
|
-
const wrapped =
|
|
219
|
+
const wrapped = helper(entity);
|
|
220
220
|
const meta = wrapped.__meta;
|
|
221
221
|
const platform = wrapped.__platform;
|
|
222
222
|
const serializedPrimaryKey = meta.props.find(p => p.serializedPrimaryKey);
|
|
@@ -250,4 +250,3 @@ class EntityHelper {
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
exports.EntityHelper = EntityHelper;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityIdentifier = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @internal
|
|
6
3
|
*/
|
|
7
|
-
class EntityIdentifier {
|
|
4
|
+
export class EntityIdentifier {
|
|
8
5
|
value;
|
|
9
6
|
constructor(value) {
|
|
10
7
|
this.value = value;
|
|
@@ -16,4 +13,3 @@ class EntityIdentifier {
|
|
|
16
13
|
return this.value;
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.EntityIdentifier = EntityIdentifier;
|
package/entity/EntityLoader.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ConnectionType, Dictionary, FilterQuery, PopulateOptions } from '../typings';
|
|
2
|
-
import type { EntityManager } from '../EntityManager';
|
|
3
|
-
import { LoadStrategy, type LockMode, type PopulateHint, PopulatePath, type QueryOrderMap } from '../enums';
|
|
4
|
-
import type { EntityField } from '../drivers/IDatabaseDriver';
|
|
5
|
-
import type { LoggingOptions } from '../logging/Logger';
|
|
1
|
+
import type { ConnectionType, Dictionary, FilterQuery, PopulateOptions } from '../typings.js';
|
|
2
|
+
import type { EntityManager } from '../EntityManager.js';
|
|
3
|
+
import { LoadStrategy, type LockMode, type PopulateHint, PopulatePath, type QueryOrderMap } from '../enums.js';
|
|
4
|
+
import type { EntityField } from '../drivers/IDatabaseDriver.js';
|
|
5
|
+
import type { LoggingOptions } from '../logging/Logger.js';
|
|
6
6
|
export type EntityLoaderOptions<Entity, Fields extends string = PopulatePath.ALL, Excludes extends string = never> = {
|
|
7
7
|
where?: FilterQuery<Entity>;
|
|
8
8
|
populateWhere?: PopulateHint | `${PopulateHint}`;
|