Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 37 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { |
||
2 | Entity, |
||
3 | Column, |
||
4 | PrimaryGeneratedColumn, |
||
5 | ManyToOne |
||
6 | } from 'typeorm'; |
||
7 | import { Shooting } from './Shooting.entity'; |
||
8 | |||
9 | @Entity() |
||
10 | export class Classroom { |
||
11 | @PrimaryGeneratedColumn('uuid') |
||
12 | private id: string; |
||
13 | |||
14 | @Column({ type: 'varchar', nullable: false }) |
||
15 | private name: string; |
||
16 | |||
17 | @ManyToOne(() => Shooting, { nullable: false, onDelete: 'CASCADE' }) |
||
18 | private shooting: Shooting; |
||
19 | |||
20 | constructor(name: string, shooting: Shooting) { |
||
21 | this.name = name; |
||
22 | this.shooting = shooting; |
||
23 | } |
||
24 | |||
25 | public getId(): string { |
||
26 | return this.id; |
||
27 | } |
||
28 | |||
29 | public getName(): string { |
||
30 | return this.name; |
||
31 | } |
||
32 | |||
33 | public getShooting(): Shooting { |
||
34 | return this.shooting; |
||
35 | } |
||
36 | } |
||
37 |