@mikro-orm/core 7.0.0-dev.264 → 7.0.0-dev.265
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/EntityFactory.js +4 -1
- package/package.json +1 -1
- package/utils/Utils.js +1 -1
package/entity/EntityFactory.js
CHANGED
|
@@ -129,7 +129,10 @@ export class EntityFactory {
|
|
|
129
129
|
.filter(key => meta.properties[key]?.formula || [ReferenceKind.ONE_TO_MANY, ReferenceKind.MANY_TO_MANY].includes(meta.properties[key]?.kind))
|
|
130
130
|
.forEach(key => diff2[key] = data[key]);
|
|
131
131
|
// rehydrated with the new values, skip those changed by user
|
|
132
|
-
|
|
132
|
+
// use full hydration if the entity is already initialized, even if the caller used `initialized: false`
|
|
133
|
+
// (e.g. from createReference), otherwise scalar properties in diff2 won't be applied
|
|
134
|
+
const initialized = options.initialized || helper(entity).__initialized;
|
|
135
|
+
this.hydrate(entity, meta, diff2, initialized ? { ...options, initialized } : options);
|
|
133
136
|
// we need to update the entity data only with keys that were not present before
|
|
134
137
|
const nullVal = this.config.get('forceUndefined') ? undefined : null;
|
|
135
138
|
Utils.keys(diff2).forEach(key => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.265",
|
|
5
5
|
"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.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
package/utils/Utils.js
CHANGED
|
@@ -123,7 +123,7 @@ export function parseJsonSafe(value) {
|
|
|
123
123
|
}
|
|
124
124
|
export class Utils {
|
|
125
125
|
static PK_SEPARATOR = '~~~';
|
|
126
|
-
static #ORM_VERSION = '7.0.0-dev.
|
|
126
|
+
static #ORM_VERSION = '7.0.0-dev.265';
|
|
127
127
|
/**
|
|
128
128
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
129
129
|
*/
|