@mikro-orm/core
Advanced tools
+1
-1
| { | ||
| "name": "@mikro-orm/core", | ||
| "version": "7.1.9-dev.10", | ||
| "version": "7.1.9-dev.11", | ||
| "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,0 +5,0 @@ "keywords": [ |
@@ -240,3 +240,4 @@ import { EntityIdentifier } from '../entity/EntityIdentifier.js'; | ||
| const row = map.get(helper(changeSet.entity).getSerializedPrimaryKey()); | ||
| this.mapReturnedValues(changeSet.entity, changeSet.payload, row, meta); | ||
| // STI batches can mix child types, so map through the change set's own metadata | ||
| this.mapReturnedValues(changeSet.entity, changeSet.payload, row, changeSet.meta); | ||
| } | ||
@@ -382,3 +383,4 @@ changeSet.persisted = true; | ||
| if (isRaw(cs.payload[k]) && isRaw(cs.entity[k])) { | ||
| returning.add(meta.properties[k]); | ||
| // STI batches can mix child types, so the property might not exist on `meta` | ||
| returning.add(cs.meta.properties[k]); | ||
| } | ||
@@ -408,3 +410,5 @@ }); | ||
| }); | ||
| const data = await this.#driver.find(meta.class, { [pk]: { $in: pks } }, options); | ||
| // a mixed STI batch shares one table but the child discriminator would filter out the siblings | ||
| const target = changeSets.some(cs => cs.meta !== meta) && meta.root.discriminatorColumn ? meta.root : meta; | ||
| const data = await this.#driver.find(target.class, { [pk]: { $in: pks } }, options); | ||
| const map = new Map(); | ||
@@ -414,3 +418,3 @@ data.forEach(item => map.set(Utils.getCompositeKeyHash(item, meta, false, this.#platform, true), item)); | ||
| const data = map.get(helper(changeSet.entity).getSerializedPrimaryKey()); | ||
| this.#hydrator.hydrate(changeSet.entity, meta, data, this.#factory, 'full', false, true); | ||
| this.#hydrator.hydrate(changeSet.entity, changeSet.meta, data, this.#factory, 'full', false, true); | ||
| Object.assign(changeSet.payload, data); // merge to the changeset payload, so it gets saved to the entity snapshot | ||
@@ -417,0 +421,0 @@ } |
+1
-1
@@ -156,3 +156,3 @@ import { clone } from './clone.js'; | ||
| static PK_SEPARATOR = '~~~'; | ||
| static #ORM_VERSION = '7.1.9-dev.10'; | ||
| static #ORM_VERSION = '7.1.9-dev.11'; | ||
| /** | ||
@@ -159,0 +159,0 @@ * Checks if the argument is instance of `Object`. Returns false for arrays. |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
1575744
0.03%33673
0.01%