From 347f3a704e51f8fc3c3de0f17e46cb3da005c0f5 Mon Sep 17 00:00:00 2001 From: isieun0908 Date: Thu, 16 Mar 2023 20:33:18 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Channel=20Entity=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=20(#1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classmate/channel/domain/Channel.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 classmate-backend-main/classmate/src/main/java/devteamOne/classmate/channel/domain/Channel.java diff --git a/classmate-backend-main/classmate/src/main/java/devteamOne/classmate/channel/domain/Channel.java b/classmate-backend-main/classmate/src/main/java/devteamOne/classmate/channel/domain/Channel.java new file mode 100644 index 0000000..c39d1b5 --- /dev/null +++ b/classmate-backend-main/classmate/src/main/java/devteamOne/classmate/channel/domain/Channel.java @@ -0,0 +1,37 @@ +package devteamOne.classmate.channel.domain; + +import devteamOne.classmate.participant.domain.Participant; +import devteamOne.classmate.question.domain.Question; +import devteamOne.classmate.survey.domain.Survey; +import devteamOne.classmate.user.domain.User; +import jakarta.persistence.*; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Entity +public class Channel { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String name; + + private String code; + + private LocalDateTime createdAt; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "user_id") + private User user; + + @OneToMany(mappedBy = "channel") + private List questionList = new ArrayList<>(); + + @OneToMany(mappedBy = "channel") + private List surveyList = new ArrayList<>(); + + @OneToMany(mappedBy = "channel") + private List participantList = new ArrayList<>(); +} \ No newline at end of file