Guest User

Untitled

a guest
Apr 23rd, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1. package datebase.entity;
  2.  
  3. import javax.persistence.*;
  4. import java.util.ArrayList;
  5. import java.util.List;
  6.  
  7. @Entity
  8. public class Meal {
  9.  
  10.     @Id
  11.     @GeneratedValue(strategy = GenerationType.IDENTITY)
  12.     private long id;
  13.  
  14.     @Column(name="name_of_meal")
  15.     private String nameOfMeal;
  16.  
  17.     @Column(name="price")
  18.     private double price;
  19.  
  20.     public Meal(){}
  21.  
  22.     public Meal(String nameOfMeal, double price){
  23.         this.nameOfMeal = nameOfMeal;
  24.         this.price = price;
  25.     }
  26.  
  27.     public long getId() {
  28.         return id;
  29.     }
  30.  
  31.     public void setId(long id) {
  32.         this.id = id;
  33.     }
  34.  
  35.     public String getNameOfMeal() {
  36.         return nameOfMeal;
  37.     }
  38.  
  39.     public void setNameOfMeal(String nameOfMeal) {
  40.         this.nameOfMeal = nameOfMeal;
  41.     }
  42.  
  43.     public double getPrice() {
  44.         return price;
  45.     }
  46.  
  47.     public void setPrice(double price) {
  48.         this.price = price;
  49.     }
  50.  
  51.     public String toString(){
  52.         return "Meal [id=" + id + ", nameOfMeal=" + nameOfMeal + ", price=" + price + "]";
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment