เพิ่มlink relation

This commit is contained in:
Kittapath 2024-01-31 14:29:39 +07:00
parent a41e33c0d4
commit d74c3140fa
16 changed files with 416 additions and 139 deletions

View file

@ -4,6 +4,7 @@ import { OrgRoot } from "./OrgRoot";
import { OrgChild1 } from "./OrgChild1";
import { OrgChild3 } from "./OrgChild3";
import { OrgChild4 } from "./OrgChild4";
import { OrgRevision } from "./OrgRevision";
// ENUM orgChild2Rank
enum OrgChild2Rank {
@ -105,12 +106,23 @@ export class OrgChild2 extends EntityBase {
})
isAncestorDNA: string;
@ManyToOne(() => OrgRevision, (orgRevision) => orgRevision.orgChild2s)
@JoinColumn({ name: "orgRevisionId" })
orgRevision: OrgRevision;
@ManyToOne(() => OrgRoot, (orgRoot) => orgRoot.orgChild2s)
@JoinColumn({ name: "orgRootId" })
orgRoot: OrgRoot;
@ManyToOne(() => OrgChild1, (orgChild1) => orgChild1.orgChild2s)
@JoinColumn({ name: "orgChild1Id" })
orgChild1: OrgChild1;
@OneToMany(() => OrgChild3, (orgChild3) => orgChild3.orgChild2)
orgChild3s: OrgChild3[];
@OneToMany(() => OrgChild4, (orgChild4) => orgChild4.orgChild2)
orgChild4s: OrgChild4[];
}
export class CreateOrgChild2 {