@mikro-orm/core 7.0.0-dev.33 → 7.0.0-dev.331
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 +70 -75
- package/EntityManager.js +487 -402
- package/MikroORM.d.ts +45 -38
- package/MikroORM.js +123 -156
- package/README.md +7 -4
- package/cache/FileCacheAdapter.d.ts +2 -7
- package/cache/FileCacheAdapter.js +35 -30
- package/cache/GeneratedCacheAdapter.d.ts +1 -2
- package/cache/GeneratedCacheAdapter.js +6 -8
- package/cache/MemoryCacheAdapter.d.ts +1 -2
- package/cache/MemoryCacheAdapter.js +8 -8
- package/cache/index.d.ts +1 -2
- package/cache/index.js +0 -2
- package/connections/Connection.d.ts +12 -5
- package/connections/Connection.js +37 -15
- package/drivers/DatabaseDriver.d.ts +25 -18
- package/drivers/DatabaseDriver.js +144 -45
- package/drivers/IDatabaseDriver.d.ts +118 -23
- package/entity/BaseEntity.d.ts +63 -4
- package/entity/BaseEntity.js +0 -3
- package/entity/Collection.d.ts +95 -31
- package/entity/Collection.js +487 -139
- package/entity/EntityAssigner.js +37 -25
- package/entity/EntityFactory.d.ts +8 -9
- package/entity/EntityFactory.js +152 -100
- package/entity/EntityHelper.d.ts +2 -2
- package/entity/EntityHelper.js +69 -27
- package/entity/EntityLoader.d.ts +12 -13
- package/entity/EntityLoader.js +286 -125
- package/entity/EntityRepository.d.ts +28 -8
- package/entity/EntityRepository.js +8 -2
- package/entity/PolymorphicRef.d.ts +12 -0
- package/entity/PolymorphicRef.js +18 -0
- package/entity/Reference.d.ts +3 -8
- package/entity/Reference.js +62 -29
- package/entity/WrappedEntity.d.ts +7 -10
- package/entity/WrappedEntity.js +6 -7
- package/entity/defineEntity.d.ts +472 -313
- package/entity/defineEntity.js +134 -290
- package/entity/index.d.ts +2 -2
- package/entity/index.js +2 -2
- package/entity/utils.d.ts +6 -1
- package/entity/utils.js +46 -11
- package/entity/validators.d.ts +11 -0
- package/entity/validators.js +66 -0
- package/enums.d.ts +8 -6
- package/enums.js +13 -17
- package/errors.d.ts +26 -16
- package/errors.js +63 -31
- package/events/EventManager.d.ts +3 -5
- package/events/EventManager.js +37 -26
- package/events/index.d.ts +1 -1
- package/events/index.js +0 -1
- package/exceptions.js +9 -2
- package/hydration/Hydrator.js +1 -2
- package/hydration/ObjectHydrator.d.ts +5 -6
- package/hydration/ObjectHydrator.js +109 -50
- package/index.d.ts +2 -2
- package/index.js +1 -2
- package/logging/DefaultLogger.d.ts +1 -1
- package/logging/DefaultLogger.js +3 -4
- package/logging/SimpleLogger.d.ts +1 -1
- package/logging/colors.d.ts +1 -1
- package/logging/colors.js +4 -6
- package/logging/index.d.ts +2 -1
- package/logging/index.js +1 -1
- package/logging/inspect.d.ts +2 -0
- package/logging/inspect.js +11 -0
- package/metadata/EntitySchema.d.ts +47 -23
- package/metadata/EntitySchema.js +103 -34
- package/metadata/MetadataDiscovery.d.ts +65 -18
- package/metadata/MetadataDiscovery.js +940 -424
- package/metadata/MetadataProvider.d.ts +11 -2
- package/metadata/MetadataProvider.js +71 -2
- package/metadata/MetadataStorage.d.ts +11 -13
- package/metadata/MetadataStorage.js +79 -48
- package/metadata/MetadataValidator.d.ts +32 -9
- package/metadata/MetadataValidator.js +214 -44
- 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 +0 -1
- package/metadata/types.d.ts +577 -0
- package/metadata/types.js +1 -0
- package/naming-strategy/AbstractNamingStrategy.d.ts +16 -4
- package/naming-strategy/AbstractNamingStrategy.js +26 -5
- package/naming-strategy/EntityCaseNamingStrategy.d.ts +3 -3
- package/naming-strategy/EntityCaseNamingStrategy.js +7 -6
- 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/naming-strategy/index.d.ts +1 -1
- package/naming-strategy/index.js +0 -1
- package/not-supported.d.ts +2 -0
- package/not-supported.js +8 -0
- package/package.json +47 -36
- package/platforms/ExceptionConverter.js +1 -1
- package/platforms/Platform.d.ts +33 -15
- package/platforms/Platform.js +125 -69
- package/serialization/EntitySerializer.d.ts +6 -3
- package/serialization/EntitySerializer.js +54 -30
- package/serialization/EntityTransformer.js +37 -22
- package/serialization/SerializationContext.d.ts +10 -14
- package/serialization/SerializationContext.js +24 -19
- package/types/ArrayType.d.ts +1 -1
- package/types/ArrayType.js +2 -3
- 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.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/UuidType.d.ts +2 -0
- package/types/UuidType.js +14 -2
- package/types/index.d.ts +3 -2
- package/typings.d.ts +427 -170
- package/typings.js +100 -45
- package/unit-of-work/ChangeSet.d.ts +4 -6
- package/unit-of-work/ChangeSet.js +8 -9
- package/unit-of-work/ChangeSetComputer.d.ts +2 -12
- package/unit-of-work/ChangeSetComputer.js +61 -38
- package/unit-of-work/ChangeSetPersister.d.ts +10 -17
- package/unit-of-work/ChangeSetPersister.js +136 -73
- package/unit-of-work/CommitOrderCalculator.d.ts +13 -14
- package/unit-of-work/CommitOrderCalculator.js +22 -20
- package/unit-of-work/IdentityMap.d.ts +12 -3
- package/unit-of-work/IdentityMap.js +51 -13
- package/unit-of-work/UnitOfWork.d.ts +39 -23
- package/unit-of-work/UnitOfWork.js +441 -246
- package/utils/AbstractMigrator.d.ts +101 -0
- package/utils/AbstractMigrator.js +303 -0
- package/utils/AbstractSchemaGenerator.d.ts +5 -5
- package/utils/AbstractSchemaGenerator.js +30 -18
- package/utils/AsyncContext.d.ts +6 -0
- package/utils/AsyncContext.js +42 -0
- package/utils/Configuration.d.ts +647 -185
- package/utils/Configuration.js +215 -252
- package/utils/ConfigurationLoader.d.ts +1 -52
- package/utils/ConfigurationLoader.js +1 -330
- package/utils/Cursor.d.ts +3 -6
- package/utils/Cursor.js +32 -17
- package/utils/DataloaderUtils.d.ts +10 -5
- package/utils/DataloaderUtils.js +42 -22
- package/utils/EntityComparator.d.ts +21 -21
- package/utils/EntityComparator.js +224 -118
- package/utils/QueryHelper.d.ts +34 -7
- package/utils/QueryHelper.js +183 -72
- package/utils/RawQueryFragment.d.ts +28 -34
- package/utils/RawQueryFragment.js +37 -72
- package/utils/RequestContext.js +2 -2
- package/utils/TransactionContext.js +2 -2
- package/utils/TransactionManager.js +11 -8
- package/utils/Utils.d.ts +16 -127
- package/utils/Utils.js +104 -402
- package/utils/clone.js +13 -23
- package/utils/env-vars.d.ts +7 -0
- package/utils/env-vars.js +98 -0
- package/utils/fs-utils.d.ts +20 -0
- package/utils/fs-utils.js +193 -0
- package/utils/index.d.ts +1 -3
- package/utils/index.js +1 -3
- package/utils/upsert-utils.d.ts +9 -4
- package/utils/upsert-utils.js +51 -5
- 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
package/utils/DataloaderUtils.js
CHANGED
|
@@ -3,6 +3,7 @@ import { helper } from '../entity/wrap.js';
|
|
|
3
3
|
import { Reference } from '../entity/Reference.js';
|
|
4
4
|
import { Utils } from './Utils.js';
|
|
5
5
|
export class DataloaderUtils {
|
|
6
|
+
static DataLoader;
|
|
6
7
|
/**
|
|
7
8
|
* Groups identified references by entity and returns a Map with the
|
|
8
9
|
* class name as the index and the corresponding primary keys as the value.
|
|
@@ -10,7 +11,7 @@ export class DataloaderUtils {
|
|
|
10
11
|
static groupPrimaryKeysByEntityAndOpts(refsWithOpts) {
|
|
11
12
|
const map = new Map();
|
|
12
13
|
for (const [ref, opts] of refsWithOpts) {
|
|
13
|
-
/* The key is a combination of the
|
|
14
|
+
/* The key is a combination of the uniqueName (a unique table name based identifier) and a stringified version if the load options because we want
|
|
14
15
|
to map each combination of entities/options into separate find queries in order to return accurate results.
|
|
15
16
|
This could be further optimized finding the "lowest common denominator" among the different options
|
|
16
17
|
for each Entity and firing a single query for each Entity instead of Entity+options combination.
|
|
@@ -23,7 +24,7 @@ export class DataloaderUtils {
|
|
|
23
24
|
Thus such approach should probably be configurable, if not opt-in.
|
|
24
25
|
NOTE: meta + opts multi maps (https://github.com/martian17/ds-js) might be a more elegant way
|
|
25
26
|
to implement this but not necessarily faster. */
|
|
26
|
-
const key = `${helper(ref).__meta.
|
|
27
|
+
const key = `${helper(ref).__meta.uniqueName}|${JSON.stringify(opts ?? {})}`;
|
|
27
28
|
let primaryKeysSet = map.get(key);
|
|
28
29
|
if (primaryKeysSet == null) {
|
|
29
30
|
primaryKeysSet = new Set();
|
|
@@ -41,9 +42,10 @@ export class DataloaderUtils {
|
|
|
41
42
|
return async (refsWithOpts) => {
|
|
42
43
|
const groupedIdsMap = DataloaderUtils.groupPrimaryKeysByEntityAndOpts(refsWithOpts);
|
|
43
44
|
const promises = Array.from(groupedIdsMap).map(([key, idsSet]) => {
|
|
44
|
-
const
|
|
45
|
+
const uniqueName = key.substring(0, key.indexOf('|'));
|
|
45
46
|
const opts = JSON.parse(key.substring(key.indexOf('|') + 1));
|
|
46
|
-
|
|
47
|
+
const meta = em.getMetadata().getByUniqueName(uniqueName);
|
|
48
|
+
return em.find(meta.class, Array.from(idsSet), opts);
|
|
47
49
|
});
|
|
48
50
|
await Promise.all(promises);
|
|
49
51
|
/* Instead of assigning each find result to the original reference we use a shortcut
|
|
@@ -69,7 +71,7 @@ export class DataloaderUtils {
|
|
|
69
71
|
The value is another Map which we can use to filter the find query to get results pertaining to the collections that have been dataloaded:
|
|
70
72
|
its keys are the props we are going to filter to and its values are the corresponding PKs.
|
|
71
73
|
*/
|
|
72
|
-
const key = `${col.property.targetMeta.
|
|
74
|
+
const key = `${col.property.targetMeta.uniqueName}|${JSON.stringify(opts ?? {})}`;
|
|
73
75
|
let filterMap = entitiesMap.get(key); // We are going to use this map to filter the entities pertaining to the collections that have been dataloaded.
|
|
74
76
|
if (filterMap == null) {
|
|
75
77
|
filterMap = new Map();
|
|
@@ -96,31 +98,33 @@ export class DataloaderUtils {
|
|
|
96
98
|
*/
|
|
97
99
|
static entitiesAndOptsMapToQueries(entitiesAndOptsMap, em) {
|
|
98
100
|
return Array.from(entitiesAndOptsMap, async ([key, filterMap]) => {
|
|
99
|
-
const
|
|
101
|
+
const uniqueName = key.substring(0, key.indexOf('|'));
|
|
100
102
|
const opts = JSON.parse(key.substring(key.indexOf('|') + 1));
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
+
const meta = em.getMetadata().getByUniqueName(uniqueName);
|
|
104
|
+
const res = await em.find(meta.class, opts?.where != null && Object.keys(opts.where).length > 0
|
|
105
|
+
? {
|
|
103
106
|
$and: [
|
|
104
107
|
{
|
|
105
108
|
$or: Array.from(filterMap.entries()).map(([prop, pks]) => {
|
|
106
|
-
return
|
|
109
|
+
return { [prop]: Array.from(pks) };
|
|
107
110
|
}),
|
|
108
111
|
},
|
|
109
112
|
opts.where,
|
|
110
113
|
],
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
}
|
|
115
|
+
: {
|
|
116
|
+
// The entries of the filter Map will be used as the values of the $or operator
|
|
117
|
+
$or: Array.from(filterMap.entries()).map(([prop, pks]) => {
|
|
118
|
+
return { [prop]: Array.from(pks) };
|
|
119
|
+
}),
|
|
120
|
+
}, {
|
|
117
121
|
...opts,
|
|
118
122
|
// We need to populate the inverse side of the relationship in order to be able to later retrieve the PK(s) from its item(s)
|
|
119
123
|
populate: [
|
|
120
|
-
...(opts.populate === false ? [] : opts.populate ?? []),
|
|
124
|
+
...(opts.populate === false ? [] : (opts.populate ?? [])),
|
|
121
125
|
...Array.from(filterMap.keys()).filter(
|
|
122
126
|
// We need to do so only if the inverse side is a collection, because we can already retrieve the PK from a reference without having to load it
|
|
123
|
-
prop =>
|
|
127
|
+
prop => meta.properties[prop]?.ref !== true),
|
|
124
128
|
],
|
|
125
129
|
});
|
|
126
130
|
return [key, res];
|
|
@@ -163,11 +167,11 @@ export class DataloaderUtils {
|
|
|
163
167
|
// We need to filter the results in order to map each input collection
|
|
164
168
|
// to a subset of each query matching the collection items.
|
|
165
169
|
return collsWithOpts.map(([col, opts]) => {
|
|
166
|
-
const key = `${col.property.targetMeta.
|
|
170
|
+
const key = `${col.property.targetMeta.uniqueName}|${JSON.stringify(opts ?? {})}`;
|
|
167
171
|
const entities = resultsMap.get(key);
|
|
168
172
|
if (entities == null) {
|
|
169
173
|
// Should never happen
|
|
170
|
-
/* v8 ignore next
|
|
174
|
+
/* v8 ignore next */
|
|
171
175
|
throw new Error('Cannot match results');
|
|
172
176
|
}
|
|
173
177
|
return entities.filter(DataloaderUtils.getColFilter(col));
|
|
@@ -182,7 +186,7 @@ export class DataloaderUtils {
|
|
|
182
186
|
return async (collsWithOpts) => {
|
|
183
187
|
const groups = new Map();
|
|
184
188
|
for (const [col, opts] of collsWithOpts) {
|
|
185
|
-
const key = `${col.property.targetMeta.
|
|
189
|
+
const key = `${col.property.targetMeta.uniqueName}.${col.property.name}|${JSON.stringify(opts ?? {})}`;
|
|
186
190
|
const value = groups.get(key) ?? [];
|
|
187
191
|
value.push([col, opts ?? {}]);
|
|
188
192
|
groups.set(key, value);
|
|
@@ -197,17 +201,33 @@ export class DataloaderUtils {
|
|
|
197
201
|
const owners = group.map(c => c[0].owner);
|
|
198
202
|
const $or = [];
|
|
199
203
|
// a bit of a hack, but we need to prefix the key, since we have only a column name, not a property name
|
|
200
|
-
const alias = em.config.getNamingStrategy().aliasName(prop.pivotEntity, 0);
|
|
204
|
+
const alias = em.config.getNamingStrategy().aliasName(Utils.className(prop.pivotEntity), 0);
|
|
201
205
|
const fk = `${alias}.${Utils.getPrimaryKeyHash(prop.joinColumns)}`;
|
|
202
206
|
for (const c of group) {
|
|
203
207
|
$or.push({ $and: [c[1]?.where ?? {}, { [fk]: c[0].owner }] });
|
|
204
208
|
options.refresh ??= c[1]?.refresh;
|
|
205
209
|
}
|
|
206
210
|
options.where = wrap({ $or });
|
|
207
|
-
const r = await em
|
|
211
|
+
const r = await em
|
|
212
|
+
.getEntityLoader()
|
|
213
|
+
.findChildrenFromPivotTable(owners, prop, options, orderBy, populate, group[0][1]?.ref);
|
|
208
214
|
ret.push(...r);
|
|
209
215
|
}
|
|
210
216
|
return ret;
|
|
211
217
|
};
|
|
212
218
|
}
|
|
219
|
+
static async getDataLoader() {
|
|
220
|
+
if (this.DataLoader) {
|
|
221
|
+
return this.DataLoader;
|
|
222
|
+
}
|
|
223
|
+
try {
|
|
224
|
+
const mod = await import('dataloader');
|
|
225
|
+
const DataLoader = mod.default;
|
|
226
|
+
return (this.DataLoader ??= DataLoader);
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
/* v8 ignore next */
|
|
230
|
+
throw new Error("DataLoader is not found, make sure `dataloader` package is installed in your project's dependencies.");
|
|
231
|
+
}
|
|
232
|
+
}
|
|
213
233
|
}
|
|
@@ -1,54 +1,49 @@
|
|
|
1
|
-
import type { EntityData, EntityDictionary, EntityMetadata, EntityProperty, IMetadataStorage } from '../typings.js';
|
|
1
|
+
import type { EntityData, EntityDictionary, EntityMetadata, EntityName, EntityProperty, IMetadataStorage, Primary } from '../typings.js';
|
|
2
2
|
import type { Platform } from '../platforms/Platform.js';
|
|
3
|
+
import type { Configuration } from './Configuration.js';
|
|
3
4
|
type Comparator<T> = (a: T, b: T, options?: {
|
|
4
5
|
includeInverseSides?: boolean;
|
|
5
6
|
}) => EntityData<T>;
|
|
6
7
|
type ResultMapper<T> = (result: EntityData<T>) => EntityData<T> | null;
|
|
7
8
|
type SnapshotGenerator<T> = (entity: T) => EntityData<T>;
|
|
9
|
+
type PkGetter<T> = (entity: T) => Primary<T>;
|
|
10
|
+
type PkSerializer<T> = (entity: T) => string;
|
|
8
11
|
type CompositeKeyPart = string | CompositeKeyPart[];
|
|
9
12
|
export declare class EntityComparator {
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
private readonly comparators;
|
|
13
|
-
private readonly mappers;
|
|
14
|
-
private readonly snapshotGenerators;
|
|
15
|
-
private readonly pkGetters;
|
|
16
|
-
private readonly pkGettersConverted;
|
|
17
|
-
private readonly pkSerializers;
|
|
18
|
-
private tmpIndex;
|
|
19
|
-
constructor(metadata: IMetadataStorage, platform: Platform);
|
|
13
|
+
#private;
|
|
14
|
+
constructor(metadata: IMetadataStorage, platform: Platform, config?: Configuration);
|
|
20
15
|
/**
|
|
21
16
|
* Computes difference between two entities.
|
|
22
17
|
*/
|
|
23
|
-
diffEntities<T>(entityName:
|
|
18
|
+
diffEntities<T extends object>(entityName: EntityName<T>, a: EntityData<T>, b: EntityData<T>, options?: {
|
|
24
19
|
includeInverseSides?: boolean;
|
|
25
20
|
}): EntityData<T>;
|
|
26
|
-
matching<T>(entityName:
|
|
21
|
+
matching<T extends object>(entityName: EntityName<T>, a: EntityData<T>, b: EntityData<T>): boolean;
|
|
27
22
|
/**
|
|
28
23
|
* Removes ORM specific code from entities and prepares it for serializing. Used before change set computation.
|
|
29
24
|
* References will be mapped to primary keys, collections to arrays of primary keys.
|
|
30
25
|
*/
|
|
31
|
-
prepareEntity<T>(entity: T): EntityData<T>;
|
|
26
|
+
prepareEntity<T extends object>(entity: T): EntityData<T>;
|
|
32
27
|
/**
|
|
33
28
|
* Maps database columns to properties.
|
|
34
29
|
*/
|
|
35
|
-
mapResult<T>(
|
|
30
|
+
mapResult<T>(meta: EntityMetadata<T>, result: EntityDictionary<T>): EntityData<T>;
|
|
36
31
|
/**
|
|
37
32
|
* @internal Highly performance-sensitive method.
|
|
38
33
|
*/
|
|
39
|
-
getPkGetter<T>(meta: EntityMetadata<T>):
|
|
34
|
+
getPkGetter<T>(meta: EntityMetadata<T>): PkGetter<T>;
|
|
40
35
|
/**
|
|
41
36
|
* @internal Highly performance-sensitive method.
|
|
42
37
|
*/
|
|
43
|
-
getPkGetterConverted<T>(meta: EntityMetadata<T>):
|
|
38
|
+
getPkGetterConverted<T>(meta: EntityMetadata<T>): PkGetter<T>;
|
|
44
39
|
/**
|
|
45
40
|
* @internal Highly performance-sensitive method.
|
|
46
41
|
*/
|
|
47
|
-
getPkSerializer<T>(meta: EntityMetadata<T>):
|
|
42
|
+
getPkSerializer<T>(meta: EntityMetadata<T>): PkSerializer<T>;
|
|
48
43
|
/**
|
|
49
44
|
* @internal Highly performance-sensitive method.
|
|
50
45
|
*/
|
|
51
|
-
getSnapshotGenerator<T>(entityName:
|
|
46
|
+
getSnapshotGenerator<T>(entityName: EntityName<T>): SnapshotGenerator<T>;
|
|
52
47
|
/**
|
|
53
48
|
* @internal
|
|
54
49
|
*/
|
|
@@ -64,7 +59,7 @@ export declare class EntityComparator {
|
|
|
64
59
|
/**
|
|
65
60
|
* @internal Highly performance-sensitive method.
|
|
66
61
|
*/
|
|
67
|
-
getResultMapper<T>(
|
|
62
|
+
getResultMapper<T>(meta: EntityMetadata<T>): ResultMapper<T>;
|
|
68
63
|
private getPropertyCondition;
|
|
69
64
|
private getEmbeddedArrayPropertySnapshot;
|
|
70
65
|
/**
|
|
@@ -78,11 +73,16 @@ export declare class EntityComparator {
|
|
|
78
73
|
/**
|
|
79
74
|
* @internal Highly performance-sensitive method.
|
|
80
75
|
*/
|
|
81
|
-
getEntityComparator<T extends object>(entityName:
|
|
76
|
+
getEntityComparator<T extends object>(entityName: EntityName<T>): Comparator<T>;
|
|
82
77
|
private getGenericComparator;
|
|
83
78
|
private getPropertyComparator;
|
|
84
79
|
private wrap;
|
|
85
80
|
private safeKey;
|
|
81
|
+
/**
|
|
82
|
+
* Sets the toArray helper in the context if not already set.
|
|
83
|
+
* Used for converting composite PKs to arrays.
|
|
84
|
+
*/
|
|
85
|
+
private setToArrayHelper;
|
|
86
86
|
/**
|
|
87
87
|
* perf: used to generate list of comparable properties during discovery, so we speed up the runtime comparison
|
|
88
88
|
*/
|