Skip to content

Commit

Permalink
[feat] #19 대기 엔티티 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
nykoh2001 committed Feb 13, 2024
1 parent ba9ae8a commit 96a9cb6
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/main/java/org/harang/server/domain/Waiting.java
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 96a9cb6

Please sign in to comment.