Skip to content

Commit

Permalink
Merge pull request #15 from a-romantic-cat/feat/14
Browse files Browse the repository at this point in the history
✨ Entity 어노테이션 추가
  • Loading branch information
u-genuine authored Jan 18, 2024
2 parents a3f24b6 + 925a0a2 commit 3a457d7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
15 changes: 7 additions & 8 deletions src/main/java/aromanticcat/umcproject/entity/Member.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package aromanticcat.umcproject.entity;

import lombok.*;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import lombok.Getter;

@Entity
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Member extends BaseEntity {

@Id
Expand Down
37 changes: 21 additions & 16 deletions src/main/java/aromanticcat/umcproject/entity/NangmanLetter.java
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
package aromanticcat.umcproject.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import lombok.Getter;
import lombok.*;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

@Entity
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class NangmanLetter extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@NotNull
private String sender_nickname;

private boolean is_public;
@NotNull
private Boolean is_public;

@NotNull
private String content;

private boolean has_response;
@NotNull
@Builder.Default
private Boolean has_response = false;

private int thumbs_up_cnt;
private Integer thumbs_up_cnt;

private int heart_cnt;
private Integer heart_cnt;

private int crying_cnt;
private Integer crying_cnt;

private int clover_cnt;
private Integer clover_cnt;

private int clap_cnt;
private Integer clap_cnt;

private int star_cnt;
private Integer star_cnt;

@JoinColumn(name = "member_id")
@ManyToOne(fetch = FetchType.LAZY)
Expand Down

0 comments on commit 3a457d7

Please sign in to comment.