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