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; + } +}