import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { AuthorName } from './author-name'; import { WorkAuthor } from './work-author'; @Entity() export class Author implements AuthorEntityInterface { @PrimaryGeneratedColumn() public readonly id!: number; @Column({ nullable: false, default: '', }) public nameCanonical!: string; @OneToMany(() => AuthorName, (authorName: AuthorNameEntityInterface) => authorName.entity) public names!: Promise; @OneToMany(() => WorkAuthor, (workAuthor: WorkAuthorEntityInterface) => workAuthor.author) public workAuthors!: Promise; }