- Timestamp:
- 05/02/25 00:37:10 (2 weeks ago)
- Branches:
- main
- Children:
- c44c5ed
- Parents:
- e15e8d9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/rezevirajmasa/demo/model/Menu.java
re15e8d9 r2518b3a 6 6 7 7 import java.math.BigDecimal; 8 import java.util.ArrayList; 9 import java.util.List; 8 10 9 11 @Entity … … 13 15 @Id 14 16 @GeneratedValue(strategy = GenerationType.IDENTITY) 15 @Column(name = " MenuID")17 @Column(name = "menu_id") 16 18 private Long menuID; 17 19 18 20 @ManyToOne 19 @JoinColumn(name = " RestaurantID", nullable = false)21 @JoinColumn(name = "restaurant_id", nullable = false) 20 22 @JsonIgnore 21 23 private Restaurant restaurant; 22 24 23 @Column(name = " ItemName", length = 100)25 @Column(name = "item_name", length = 100) 24 26 private String itemName; 25 27 26 @Column(name = " Category", length = 50)28 @Column(name = "category", length = 50) 27 29 private String category; 28 30 29 @Column(name = " Price", precision = 8, scale = 2)31 @Column(name = "price", precision = 8, scale = 2) 30 32 private BigDecimal price; 31 33 32 @Column(name = " Description")34 @Column(name = "description") 33 35 private String description; 34 36 35 @ Column(name = "DietaryInformation", columnDefinition = "JSONB")36 private String dietaryInformation;37 @OneToMany(mappedBy = "menu", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) 38 private List<MenuTag> tags = new ArrayList<>(); 37 39 38 40 public Menu() { 39 41 } 40 42 41 public Menu(Restaurant restaurant, String itemName, String category, BigDecimal price, String description, String dietaryInformation) { 43 public Menu(Long menuID, Restaurant restaurant, String itemName, String category, BigDecimal price, String description, List<MenuTag> tags) { 44 this.menuID = menuID; 42 45 this.restaurant = restaurant; 43 46 this.itemName = itemName; … … 45 48 this.price = price; 46 49 this.description = description; 47 this. dietaryInformation = dietaryInformation;50 this.tags = tags; 48 51 } 49 52 }
Note:
See TracChangeset
for help on using the changeset viewer.