Advertisement
andersonalmada

Untitled

Jul 30th, 2022
998
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. package br.ufc.mandacaru5.model;
  2.  
  3. import javax.persistence.Entity;
  4. import javax.persistence.GeneratedValue;
  5. import javax.persistence.Id;
  6. import javax.persistence.JoinColumn;
  7. import javax.persistence.ManyToOne;
  8.  
  9. import com.fasterxml.jackson.annotation.JsonIgnore;
  10.  
  11. @Entity
  12. public class Feedback {
  13.  
  14.     @Id
  15.     @GeneratedValue
  16.     private int id;
  17.     private String message;
  18.  
  19.     @ManyToOne
  20.     @JoinColumn(name = "product_id")
  21.     @JsonIgnore
  22.     private Product product;
  23.  
  24.     public int getId() {
  25.         return id;
  26.     }
  27.  
  28.     public void setId(int id) {
  29.         this.id = id;
  30.     }
  31.  
  32.     public String getMessage() {
  33.         return message;
  34.     }
  35.  
  36.     public void setMessage(String message) {
  37.         this.message = message;
  38.     }
  39.  
  40.     public Product getProduct() {
  41.         return product;
  42.     }
  43.  
  44.     public void setProduct(Product product) {
  45.         this.product = product;
  46.     }
  47.  
  48.     @Override
  49.     public String toString() {
  50.         return "Feedback [id=" + id + ", message=" + message + "]";
  51.     }
  52.  
  53.     public Feedback(int id, String message, Product product) {
  54.         super();
  55.         this.id = id;
  56.         this.message = message;
  57.         this.product = product;
  58.     }
  59.  
  60.     public Feedback() {
  61.         super();
  62.     }
  63.  
  64. }
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement