| package com.example.myproject.entity; |
| |
| import javax.persistence.*; |
| import javax.validation.constraints.Max; |
| import javax.validation.constraints.Min; |
| |
| @Entity |
| @Table(name = "seed_rating", uniqueConstraints = @UniqueConstraint(columnNames = {"seed_id", "user_id"})) |
| public class SeedRating { |
| |
| @Id |
| @GeneratedValue(strategy = GenerationType.IDENTITY) |
| @Column(name = "rating_id") |
| private Long ratingId; |
| |
| @Column(name = "seed_id", nullable = false) |
| private Long seedId; |
| |
| @Column(name = "user_id", nullable = false) |
| private Long userId; |
| |
| @Column(name = "score", nullable = false) |
| @Min(0) |
| @Max(10) |
| private Integer score; |
| |
| // Getters and Setters |
| public Long getRatingId() { |
| return ratingId; |
| } |
| |
| public void setRatingId(Long ratingId) { |
| this.ratingId = ratingId; |
| } |
| |
| public Long getSeedId() { |
| return seedId; |
| } |
| |
| public void setSeedId(Long seedId) { |
| this.seedId = seedId; |
| } |
| |
| public Long getUserId() { |
| return userId; |
| } |
| |
| public void setUserId(Long userId) { |
| this.userId = userId; |
| } |
| |
| public Integer getScore() { |
| return score; |
| } |
| |
| public void setScore(Integer score) { |
| this.score = score; |
| } |
| } |