File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
src/main/java/com/example/satto/domain/event/entity Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 6
6
import lombok .*;
7
7
8
8
import java .time .LocalDateTime ;
9
+ import java .util .List ;
9
10
10
11
@ Builder
11
12
@ NoArgsConstructor (access = AccessLevel .PROTECTED )
@@ -22,10 +23,10 @@ public class Event {
22
23
private LocalDateTime untilWhen ;
23
24
private String content ;
24
25
25
- @ OneToOne (mappedBy = "event" )
26
- private PhotoContest photoContest ;
26
+ @ OneToMany (mappedBy = "event" )
27
+ private List < PhotoContest > photoContestList ;
27
28
28
- @ OneToOne (mappedBy = "event" )
29
- private TimetableContest timetableContest ;
29
+ @ OneToMany (mappedBy = "event" )
30
+ private List < TimetableContest > timetableContestList ;
30
31
31
32
}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public class PhotoContest extends BaseEntity {
31
31
@ JoinColumn (name = "user_id" )
32
32
private Users user ;
33
33
34
- @ OneToOne
34
+ @ ManyToOne ( fetch = FetchType . LAZY )
35
35
@ JoinColumn (name = "event_id" )
36
36
private Event event ;
37
37
}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public class TimetableContest extends BaseEntity {
34
34
@ JoinColumn (name = "user_id" )
35
35
private Users user ;
36
36
37
- @ OneToOne
37
+ @ ManyToOne ( fetch = FetchType . LAZY )
38
38
@ JoinColumn (name = "event_id" )
39
39
private Event event ;
40
40
}
You can’t perform that action at this time.
0 commit comments