Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package be.mct.entities;
- import java.io.Serializable;
- import java.util.List;
- import javax.persistence.Entity;
- import javax.persistence.GeneratedValue;
- import javax.persistence.GenerationType;
- import javax.persistence.Id;
- import javax.persistence.ManyToMany;
- import javax.persistence.ManyToOne;
- import javax.persistence.OneToMany;
- @Entity
- public class Beer implements Serializable{
- //vars
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private Long id;
- @ManyToMany(mappedBy = "favorites")
- private List<BeerLover> lovers;
- @OneToMany(mappedBy = "beer")
- private List<BeerReview> reviews;
- @ManyToOne
- private BeerLover owner;
- private String name, brewery, picture, description;
- private double alcoholicPercentage;
- public double getAlcoholicPercentage() {
- return alcoholicPercentage;
- }
- public void setAlcoholicPercentage(double alcoholicPercentage) {
- this.alcoholicPercentage = alcoholicPercentage;
- }
- public String getBrewery() {
- return brewery;
- }
- public void setBrewery(String brewery) {
- this.brewery = brewery;
- }
- public String getDescription() {
- return description;
- }
- public void setDescription(String description) {
- this.description = description;
- }
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public List<BeerLover> getLovers() {
- return lovers;
- }
- public void setLovers(List<BeerLover> lovers) {
- this.lovers = lovers;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public BeerLover getOwner() {
- return owner;
- }
- public void setOwner(BeerLover owner) {
- this.owner = owner;
- }
- public String getPicture() {
- return picture;
- }
- public void setPicture(String picture) {
- this.picture = picture;
- }
- public List<BeerReview> getReviews() {
- return reviews;
- }
- public void setReviews(List<BeerReview> reviews) {
- this.reviews = reviews;
- }
- }
Add Comment
Please, Sign In to add comment