Skip to content

Commit 2a26904

Browse files
authored
Merge pull request #174 from SMU-SATTO/feature/#21
🐛 [FIX] 카테고리별 이벤트 테이블 중복 고유값 설정으로 인한 오류 수정
2 parents e6713ca + 70c0624 commit 2a26904

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/main/java/com/example/satto/domain/event/entity/Event.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import lombok.*;
77

88
import java.time.LocalDateTime;
9+
import java.util.List;
910

1011
@Builder
1112
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@@ -22,10 +23,10 @@ public class Event {
2223
private LocalDateTime untilWhen;
2324
private String content;
2425

25-
@OneToOne(mappedBy = "event")
26-
private PhotoContest photoContest;
26+
@OneToMany(mappedBy = "event")
27+
private List<PhotoContest> photoContestList;
2728

28-
@OneToOne(mappedBy = "event")
29-
private TimetableContest timetableContest;
29+
@OneToMany(mappedBy = "event")
30+
private List<TimetableContest> timetableContestList;
3031

3132
}

src/main/java/com/example/satto/domain/event/entity/photoContest/PhotoContest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class PhotoContest extends BaseEntity {
3131
@JoinColumn(name = "user_id")
3232
private Users user;
3333

34-
@OneToOne
34+
@ManyToOne(fetch = FetchType.LAZY)
3535
@JoinColumn(name = "event_id")
3636
private Event event;
3737
}

src/main/java/com/example/satto/domain/event/entity/timetableContest/TimetableContest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class TimetableContest extends BaseEntity {
3434
@JoinColumn(name = "user_id")
3535
private Users user;
3636

37-
@OneToOne
37+
@ManyToOne(fetch = FetchType.LAZY)
3838
@JoinColumn(name = "event_id")
3939
private Event event;
4040
}

0 commit comments

Comments
 (0)