I have 2 entities
@Entity()
class UserEntity {
@OneToOne()
book: BookEntity;
}
and
@Entity()
class BookEntity {
public myCustomMethod(): boolean {
return true;
}
}
When I join UserEntity and BookEntity I lose myCustomMethod and calling it like user.book.myCustomMethod throws myCustomMethod is not a function.
Basically I think the join fills user.book as plain javascript object and not new BookEntity().
Is there anyway to keep it?