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

@ -8,9 +8,9 @@ import { StudentRepository } from '../../data/users/student-repository.js';
repository: () => StudentRepository,
})
export class Student extends User {
@ManyToMany(() => Class)
@ManyToMany({entity: () => Class, mappedBy: 'students'})
classes!: Collection<Class>;
@ManyToMany(() => Group)
groups!: Collection<Group>;
@ManyToMany({entity: () => Group, mappedBy: 'members'})
groups: Collection<Group> = new Collection<Group>(this);
}