Skip to content

Instantly share code, notes, and snippets.

@B4nan
Created February 6, 2022 02:27
Show Gist options
  • Save B4nan/3fb771464e4c4499c26c9f4e684692a4 to your computer and use it in GitHub Desktop.
Save B4nan/3fb771464e4c4499c26c9f4e684692a4 to your computer and use it in GitHub Desktop.
@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