We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c30b485 commit 7962036Copy full SHA for 7962036
src/connection/Connection.ts
@@ -481,8 +481,12 @@ export class Connection {
481
*/
482
protected findMetadata(target: Function|EntitySchema<any>|string): EntityMetadata|undefined {
483
return this.entityMetadatas.find(metadata => {
484
- if (metadata.target === target)
+ if (typeof metadata.target === "function" && typeof target === "function" && metadata.target.name === target.name) {
485
return true;
486
+ }
487
+ if (metadata.target === target) {
488
+ return true;
489
490
if (target instanceof EntitySchema) {
491
return metadata.name === target.options.name;
492
}
0 commit comments