fixed issues in the update by relation operation

This commit is contained in:
Umed Khudoiberdiev 2016-06-03 00:29:44 +05:00
parent 0c20445d83
commit 2212868554

View File

@ -306,7 +306,7 @@ export class PersistOperationExecutor {
let tableName: string, relationName: string, relationId: any, idColumn: string, id: any;
const relatedInsertOperation = insertOperations.find(o => o.entity === operation.targetEntity);
const idInInserts = relatedInsertOperation ? relatedInsertOperation.entityId : null;
if (operation.updatedRelation.isOneToMany) {
if (operation.updatedRelation.isOneToMany || operation.updatedRelation.isOneToOneNotOwner) {
const metadata = this.entityMetadatas.findByTarget(operation.insertOperation.entity.constructor);
tableName = metadata.table.name;
relationName = operation.updatedRelation.inverseRelation.name;