1 | package com.example.rezevirajmasa.demo.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 |
|
---|
5 | import java.math.BigDecimal;
|
---|
6 |
|
---|
7 | @Entity
|
---|
8 | @Table(name = "menus")
|
---|
9 | public class Menu {
|
---|
10 | @Id
|
---|
11 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
12 | @Column(name = "MenuID")
|
---|
13 | private Long menuID;
|
---|
14 |
|
---|
15 | @ManyToOne
|
---|
16 | @JoinColumn(name = "RestaurantID", nullable = false)
|
---|
17 | private Restaurant restaurant;
|
---|
18 |
|
---|
19 | @Column(name = "ItemName", length = 100)
|
---|
20 | private String itemName;
|
---|
21 |
|
---|
22 | @Column(name = "Category", length = 50)
|
---|
23 | private String category;
|
---|
24 |
|
---|
25 | @Column(name = "Price", precision = 8, scale = 2)
|
---|
26 | private BigDecimal price;
|
---|
27 |
|
---|
28 | @Column(name = "Description")
|
---|
29 | private String description;
|
---|
30 |
|
---|
31 | @Column(name = "DietaryInformation", columnDefinition = "JSONB")
|
---|
32 | private String dietaryInformation;
|
---|
33 |
|
---|
34 | public Menu() {
|
---|
35 | }
|
---|
36 |
|
---|
37 | public Menu(Restaurant restaurant, String itemName, String category, BigDecimal price, String description, String dietaryInformation) {
|
---|
38 | this.restaurant = restaurant;
|
---|
39 | this.itemName = itemName;
|
---|
40 | this.category = category;
|
---|
41 | this.price = price;
|
---|
42 | this.description = description;
|
---|
43 | this.dietaryInformation = dietaryInformation;
|
---|
44 | }
|
---|
45 | } |
---|