Repository: typeorm/typeorm
File: src/metadata/RelationMetadata.ts (TypeScript)

Code before:
                // if (!object[embeddedMetadata.propertyName])
                //     object[embeddedMetadata.propertyName] = embeddedMetadata.create();

                const embeddedMetadata = embeddedMetadatas.shift()
                if (embeddedMetadata) {
                    if (!map[embeddedMetadata.propertyName])
                        map[embeddedMetadata.propertyName] =
                            embeddedMetadata.create()

                    extractEmbeddedColumnValue(
                        embeddedMetadatas,
                        map[embeddedMetadata.propertyName],
                    )
                    return map
                }
                map[propertyName] = value
                return map
            }
            return extractEmbeddedColumnValue(
                [...this.embeddedMetadata.embeddedMetadataTree],
                entity,
            )
        } else {
            if (ObjectUtils.isObject(entity[propertyName]))
                ObjectUtils.assign(value, entity[propertyName])
            entity[propertyName] = value
        }
    }

    /**
     * Creates entity id map from the given entity ids array.
     */
    createValueMap(value: any) {
        // extract column value from embeds of entity if column is in embedded
        if (this.embeddedMetadata) {
            // example: post[data][information][counters].id where "data", "information" and "counters" are embeddeds
            // we need to get value of "id" column from the post real entity object and return it in a
            // { data: { information: { counters: { id: ... } } } } format

            // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]
            const propertyNames = [...this.embeddedMetadata.parentPropertyNames]

            // now need to access post[data][information][counters] to get column value from the counters
            // and on each step we need to create complex literal object, e.g. first { data },
            // then { data: { information } }, then { data: { information: { counters } } },
            // then { data: { information: { counters: [this.propertyName]: entity[data][information][counters][this.propertyName] } } }
            // this recursive function helps doing that
            const extractEmbeddedColumnValue = (
                propertyNames: string[],
                map: ObjectLiteral,
            ): any => {

Review comment (suggestion):
If I'm reading it right, the proposed change will only augment `entity[propertyName]` with _additional_ fields from `value`. Any fields already existing in `entity[propertyName]` won't be modified.

Also note that `ObjectUtils.assign()` mutates the target object. Depending on the `value` being passed, this might have unintended consequences.

Should we be merging objects deeply here? Is it possible for there to be two joins with overlapping _nested_ relations? 

```suggestion
            if (ObjectUtils.isObject(entity[propertyName])) {
                entity[propertyName] = OrmUtils.mergeDeep(entity[propertyName], value)
            } else {
                entity[propertyName] = value
            }
```

Code after:
            ): any => {
                // if (!object[embeddedMetadata.propertyName])
                //     object[embeddedMetadata.propertyName] = embeddedMetadata.create();

                const embeddedMetadata = embeddedMetadatas.shift()
                if (embeddedMetadata) {
                    if (!map[embeddedMetadata.propertyName])
                        map[embeddedMetadata.propertyName] =
                            embeddedMetadata.create()

                    extractEmbeddedColumnValue(
                        embeddedMetadatas,
                        map[embeddedMetadata.propertyName],
                    )
                    return map
                }
                map[propertyName] = value
                return map
            }
            return extractEmbeddedColumnValue(
                [...this.embeddedMetadata.embeddedMetadataTree],
                entity,
            )
        } else {
            if (ObjectUtils.isObject(entity[propertyName])) {
                OrmUtils.mergeDeep(entity[propertyName], value)
            } else {
                entity[propertyName] = value
            }
        }
    }

    /**
     * Creates entity id map from the given entity ids array.
     */
    createValueMap(value: any) {
        // extract column value from embeds of entity if column is in embedded
        if (this.embeddedMetadata) {
            // example: post[data][information][counters].id where "data", "information" and "counters" are embeddeds
            // we need to get value of "id" column from the post real entity object and return it in a
            // { data: { information: { counters: { id: ... } } } } format

            // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]
            const propertyNames = [...this.embeddedMetadata.parentPropertyNames]

            // now need to access post[data][information][counters] to get column value from the counters
            // and on each step we need to create complex literal object, e.g. first { data },
            // then { data: { information } }, then { data: { information: { counters } } },
            // then { data: { information: { counters: [this.propertyName]: entity[data][information][counters][this.propertyName] } } }
            // this recursive function helps doing that
            const extractEmbeddedColumnValue = (