fix(backend): Modellering van ManyToMany-relationships verbeterd

This commit is contained in:
Gerald Schmittinger 2025-04-15 08:45:12 +02:00
parent f4fda7db5d
commit 451ac7546f
6 changed files with 13 additions and 17 deletions

View file

@ -14,9 +14,9 @@ export class Class {
@Property({ type: 'string' })
displayName!: string;
@ManyToMany(() => Teacher)
@ManyToMany({entity: () => Teacher, owner: true, inversedBy: 'classes'})
teachers!: Collection<Teacher>;
@ManyToMany(() => Student)
@ManyToMany({entity: () => Student, owner: true, inversedBy: 'classes'})
students!: Collection<Student>;
}