source: src/main/java/com/example/rezevirajmasa/demo/model/Menu.java@ e15e8d9

main
Last change on this file since e15e8d9 was e15e8d9, checked in by Aleksandar Panovski <apano77@…>, 2 months ago

menu feature done

  • Property mode set to 100644
File size: 1.3 KB
Line 
1package com.example.rezevirajmasa.demo.model;
2
3import com.fasterxml.jackson.annotation.JsonIgnore;
4import jakarta.persistence.*;
5import lombok.Data;
6
7import java.math.BigDecimal;
8
9@Entity
10@Table(name = "menus")
11@Data
12public class Menu {
13 @Id
14 @GeneratedValue(strategy = GenerationType.IDENTITY)
15 @Column(name = "MenuID")
16 private Long menuID;
17
18 @ManyToOne
19 @JoinColumn(name = "RestaurantID", nullable = false)
20 @JsonIgnore
21 private Restaurant restaurant;
22
23 @Column(name = "ItemName", length = 100)
24 private String itemName;
25
26 @Column(name = "Category", length = 50)
27 private String category;
28
29 @Column(name = "Price", precision = 8, scale = 2)
30 private BigDecimal price;
31
32 @Column(name = "Description")
33 private String description;
34
35 @Column(name = "DietaryInformation", columnDefinition = "JSONB")
36 private String dietaryInformation;
37
38 public Menu() {
39 }
40
41 public Menu(Restaurant restaurant, String itemName, String category, BigDecimal price, String description, String dietaryInformation) {
42 this.restaurant = restaurant;
43 this.itemName = itemName;
44 this.category = category;
45 this.price = price;
46 this.description = description;
47 this.dietaryInformation = dietaryInformation;
48 }
49}
Note: See TracBrowser for help on using the repository browser.