From 96a9cb6bc47e2e66a67ee318f2424945ad20e4ab Mon Sep 17 00:00:00 2001 From: nykoh2001 Date: Tue, 13 Feb 2024 15:24:15 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20#19=20=EB=8C=80=EA=B8=B0=20=EC=97=94?= =?UTF-8?q?=ED=8B=B0=ED=8B=B0=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/harang/server/domain/Waiting.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/main/java/org/harang/server/domain/Waiting.java diff --git a/src/main/java/org/harang/server/domain/Waiting.java b/src/main/java/org/harang/server/domain/Waiting.java new file mode 100644 index 0000000..f718143 --- /dev/null +++ b/src/main/java/org/harang/server/domain/Waiting.java @@ -0,0 +1,37 @@ +package org.harang.server.domain; + +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Waiting { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "post_id", nullable = false) + private Post post; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "member_id", nullable = false) + private Member member; + + @Builder + public Waiting(Post post, Member member) { + this.post = post; + this.member = member; + } +}