enitity startegy
This commit is contained in:
parent
b8e1c93cb4
commit
f14478274b
5 changed files with 275 additions and 0 deletions
50
src/entities/StrategyChild2.ts
Normal file
50
src/entities/StrategyChild2.ts
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { StrategyChild1 } from "./StrategyChild1";
|
||||
import { StrategyChild3 } from "./StrategyChild3";
|
||||
import { StrategyChild4 } from "./StrategyChild4";
|
||||
import { StrategyChild5 } from "./StrategyChild5";
|
||||
|
||||
|
||||
@Entity("strategyChild2")
|
||||
export class StrategyChild2 extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อยุทธศาสตร์/แผน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
strategyChild2Name: string;
|
||||
|
||||
@Column({
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง strategyChild1",
|
||||
})
|
||||
strategyChild1Id: string;
|
||||
|
||||
@ManyToOne(() => StrategyChild1, (strategyChild1) => strategyChild1.strategyChild2s)
|
||||
@JoinColumn({ name: "strategyChild1Id" })
|
||||
strategyChild1: StrategyChild1;
|
||||
|
||||
@OneToMany(() => StrategyChild3, (strategyChild3) => strategyChild3.strategyChild2)
|
||||
strategyChild3s: StrategyChild3[];
|
||||
|
||||
@OneToMany(() => StrategyChild4, (strategyChild4) => strategyChild4.strategyChild2)
|
||||
strategyChild4s: StrategyChild4[];
|
||||
|
||||
@OneToMany(() => StrategyChild5, (strategyChild5) => strategyChild5.strategyChild2)
|
||||
strategyChild5s: StrategyChild5[];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
export class CreateStrategyChild2 {
|
||||
@Column()
|
||||
strategyChild2Name: string;
|
||||
|
||||
@Column("uuid")
|
||||
strategyChild1Id: string;
|
||||
}
|
||||
|
||||
export type UpdateStrategyChild2 = Partial<CreateStrategyChild2>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue