@mikro-orm/core 7.0.16-dev.7 → 7.0.16-dev.8

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.
@@ -665,8 +665,11 @@ export class EntityLoader {
665
665
  }
666
666
  return ret;
667
667
  }, []);
668
- // we need to automatically select the FKs too, e.g. for 1:m relations to be able to wire them with the items
669
- if (prop.kind === ReferenceKind.ONE_TO_MANY || prop.kind === ReferenceKind.MANY_TO_MANY) {
668
+ // we need to automatically select the FKs too, e.g. for 1:m and inverse 1:1 relations
669
+ // to be able to wire them with the items
670
+ if (prop.kind === ReferenceKind.ONE_TO_MANY ||
671
+ prop.kind === ReferenceKind.MANY_TO_MANY ||
672
+ (prop.kind === ReferenceKind.ONE_TO_ONE && !prop.owner)) {
670
673
  const owner = prop.targetMeta.properties[prop.mappedBy];
671
674
  // when the owning FK is lazy, we need to explicitly select it even without user-provided fields,
672
675
  // otherwise the driver will exclude it and we won't be able to map children to their parent collections
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
- "version": "7.0.16-dev.7",
3
+ "version": "7.0.16-dev.8",
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.16-dev.7';
144
+ static #ORM_VERSION = '7.0.16-dev.8';
145
145
  /**
146
146
  * Checks if the argument is instance of `Object`. Returns false for arrays.
147
147
  */