Created
February 6, 2022 02:27
-
-
Save B4nan/3fb771464e4c4499c26c9f4e684692a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity() | |
export class Book { | |
@ManyToOne(() => Author, { wrappedReference: true }) | |
author!: IdentifiedReference<Author>; | |
constructor(authorId: number) { | |
this.author = Reference.createFromPK(Author, authorId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment