diff --git a/src/main/java/opgg/weba/JamPick/domain/Vote.java b/src/main/java/opgg/weba/JamPick/domain/Vote.java new file mode 100644 index 0000000..ba2a68d --- /dev/null +++ b/src/main/java/opgg/weba/JamPick/domain/Vote.java @@ -0,0 +1,31 @@ +package opgg.weba.JamPick.domain; + +import lombok.Getter; +import lombok.Setter; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Entity +@Getter +@Setter +public class Vote { + + @Id + @Column(name = "vote_id") + private Long voteId; + + @Column(name = "created_at") + private Date createdAt; + + @Column(name = "is_vote_end") + private Boolean isVoteEnd; + + @OneToMany(mappedBy = "vote") + private List voteAppDetails = new ArrayList<>(); +} diff --git a/src/main/java/opgg/weba/JamPick/domain/VoteAppDetail.java b/src/main/java/opgg/weba/JamPick/domain/VoteAppDetail.java new file mode 100644 index 0000000..1917954 --- /dev/null +++ b/src/main/java/opgg/weba/JamPick/domain/VoteAppDetail.java @@ -0,0 +1,27 @@ +package opgg.weba.JamPick.domain; + +import lombok.Getter; +import lombok.Setter; + +import javax.persistence.*; + +@Entity +@Getter +@Setter +public class VoteAppDetail { + + @Id + @Column(name = "vote_app_detail_id") + private Long voteAppDetailId; + + @Column(name = "like_count") + private Integer likeCount; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "vote_id") + private Vote vote; + + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "indie_app_id") + private IndieApp indieApp; +}