import Column from "@entity-access/entity-access/dist/decorators/Column.js"; import { AppRole } from "./AppRole.js"; import { User } from "./User.js"; import Table from "@entity-access/entity-access/dist/decorators/Table.js"; import { RelateTo } from "@entity-access/entity-access/dist/decorators/Relate.js"; @Table("UserRoles") export class UserRole { @Column({ dataType: "BigInt", key: true, order: 1}) @RelateTo(User, { property: (ur) => ur.user, inverseProperty: (user) => user.roles }) public userID: number; @Column({ dataType: "Char", length: 200, key: true, order : 2 }) @RelateTo(AppRole, { property: (ur) => ur.role, inverseProperty: (ar) => ar.roles }) public roleName: string; public role: AppRole; public user: User; }