Skip to content

Commit

Permalink
[FEAT] #36 - Implement Vote, VoteAppDetail tables
Browse files Browse the repository at this point in the history
  • Loading branch information
sgh002400 committed Aug 25, 2021
1 parent 9da4aa3 commit 1140f89
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/main/java/opgg/weba/JamPick/domain/Vote.java
Original file line number Diff line number Diff line change
@@ -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<VoteAppDetail> voteAppDetails = new ArrayList<>();
}
27 changes: 27 additions & 0 deletions src/main/java/opgg/weba/JamPick/domain/VoteAppDetail.java
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 1140f89

Please sign in to comment.