Skip to content

Commit

Permalink
Revert "fix: STI types on children in joins (#3160)" (#8309)
Browse files Browse the repository at this point in the history
This reverts commit 60a6c5d.
  • Loading branch information
pleerock authored Oct 27, 2021
1 parent 2c861af commit 0adad88
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 200 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,8 @@ export class RawSqlResultsToEntityTransformer {

// this check need to avoid setting properties than not belong to entity when single table inheritance used. (todo: check if we still need it)
// const metadata = metadata.childEntityMetadatas.find(childEntityMetadata => discriminatorValue === childEntityMetadata.discriminatorValue);
if (join.relation) {
const relation = metadata.relations.find(relation => relation.propertyPath === join.relation!.propertyPath);
if (!relation)
return;

// Use current entity's type metadata, join might be from an STI parent with a different type
if (relation.inverseEntityMetadata)
join.alias.metadata = relation.inverseEntityMetadata;
}
if (join.relation && !metadata.relations.find(relation => relation === join.relation))
return;

// some checks to make sure this join is for current alias
if (join.mapToProperty) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 0adad88

Please sign in to comment.