@mikro-orm/core 7.0.10-dev.13 → 7.0.10-dev.14
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/entity/EntityLoader.js +16 -0
- package/package.json +1 -1
- package/utils/Utils.js +1 -1
package/entity/EntityLoader.js
CHANGED
|
@@ -489,6 +489,22 @@ export class EntityLoader {
|
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
if (populated.length === 0 && !populate.children) {
|
|
492
|
+
// Populate child-specific relations for TPT entities already in the identity map (GH #7529).
|
|
493
|
+
// Pass a sentinel hint so the existing TPT child handling in `populate()` does the real work.
|
|
494
|
+
if (populate.all && prop.targetMeta?.inheritanceType === 'tpt') {
|
|
495
|
+
const visited = options.visited;
|
|
496
|
+
const pending = Utils.unique(children).filter(c => helper(c).__meta !== prop.targetMeta && !visited.has(c));
|
|
497
|
+
if (pending.length > 0) {
|
|
498
|
+
const hint = [
|
|
499
|
+
{ field: prop.targetMeta.primaryKeys[0], strategy: LoadStrategy.SELECT_IN, all: true },
|
|
500
|
+
];
|
|
501
|
+
await this.populate(prop.targetMeta.class, pending, hint, {
|
|
502
|
+
...options,
|
|
503
|
+
lookup: false,
|
|
504
|
+
validate: false,
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|
|
492
508
|
return;
|
|
493
509
|
}
|
|
494
510
|
const fields = this.buildFields(options.fields, prop);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "7.0.10-dev.
|
|
3
|
+
"version": "7.0.10-dev.14",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
package/utils/Utils.js
CHANGED
|
@@ -141,7 +141,7 @@ export function parseJsonSafe(value) {
|
|
|
141
141
|
/** Collection of general-purpose utility methods used throughout the ORM. */
|
|
142
142
|
export class Utils {
|
|
143
143
|
static PK_SEPARATOR = '~~~';
|
|
144
|
-
static #ORM_VERSION = '7.0.10-dev.
|
|
144
|
+
static #ORM_VERSION = '7.0.10-dev.14';
|
|
145
145
|
/**
|
|
146
146
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
147
147
|
*/
|