1 | package com.example.rezevirajmasa.demo.model;
|
---|
2 |
|
---|
3 | import com.fasterxml.jackson.annotation.JsonIgnore;
|
---|
4 | import jakarta.persistence.*;
|
---|
5 | import lombok.Data;
|
---|
6 |
|
---|
7 | import java.math.BigDecimal;
|
---|
8 |
|
---|
9 | @Entity
|
---|
10 | @Table(name = "menus")
|
---|
11 | @Data
|
---|
12 | public 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 | } |
---|