export class Contact extends BaseEntity {
...
@ManyToOne(() => User, { nullable: false })
@JoinColumn({ name: 'user_id' })
user: User;
...
}
const repo = new Repository<User> ();
const response = await repo.findAll();
console.log(response);
console.log:
[
Contact {
id: 1,
...
},
Contact {
id: 2,
...
}
]
I am trying to fetch all the columns included on my Contact, but I only able to fetch the columns that does not have any relationship from the other entity.
It does not include user_id columns. Why can't to get foreign key for instance?