source: src/main/java/com/example/fooddeliverysystem/model/FoodItem.java

Last change on this file was 8d11f8c, checked in by jovanmanchev <jovanmanchev3003@…>, 20 months ago

code added, trial 2

  • Property mode set to 100644
File size: 1.3 KB
Line 
1package com.example.fooddeliverysystem.model;
2
3import com.example.fooddeliverysystem.model.enums.Role;
4import jakarta.persistence.*;
5import lombok.AllArgsConstructor;
6import lombok.Data;
7import lombok.NoArgsConstructor;
8
9import java.util.List;
10
11@Entity
12@Table(name = "hrana")
13
14@AllArgsConstructor
15@NoArgsConstructor
16public class FoodItem {
17
18 @Id
19 @Column(name = "id_stavka")
20 private Long foodItemId;
21
22 @Column(name = "ime_hra")
23 private String foodItemName;
24
25 @ManyToOne
26 @JoinColumn(name = "vrabotenpd_id")
27 private SalePlaceEmployee salePlaceEmployee;
28
29 @ManyToOne
30 @JoinColumn(name = "id_mesto")
31 private SalePlace salePlace;
32
33 @ManyToMany(fetch = FetchType.EAGER)
34 @JoinTable(name = "hrana_e_napravena_namirnica",
35 joinColumns = @JoinColumn(name = "id_stavka"),
36 inverseJoinColumns = @JoinColumn(name = "id_namirnica"))
37 private List<FoodStructure> foodStructures;
38
39 public Long getFoodItemId() {
40 return foodItemId;
41 }
42
43 public String getFoodItemName() {
44 return foodItemName;
45 }
46
47 public SalePlaceEmployee getSalePlaceEmployee() {
48 return salePlaceEmployee;
49 }
50
51 public SalePlace getSalePlace() {
52 return salePlace;
53 }
54
55 public List<FoodStructure> getFoodStructures() {
56 return foodStructures;
57 }
58}
Note: See TracBrowser for help on using the repository browser.