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 | |
---|
1 | package com.example.fooddeliverysystem.model;
|
---|
2 |
|
---|
3 | import com.example.fooddeliverysystem.model.enums.Role;
|
---|
4 | import jakarta.persistence.*;
|
---|
5 | import lombok.AllArgsConstructor;
|
---|
6 | import lombok.Data;
|
---|
7 | import lombok.NoArgsConstructor;
|
---|
8 |
|
---|
9 | import java.util.List;
|
---|
10 |
|
---|
11 | @Entity
|
---|
12 | @Table(name = "hrana")
|
---|
13 |
|
---|
14 | @AllArgsConstructor
|
---|
15 | @NoArgsConstructor
|
---|
16 | public 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.