main
Last change
on this file since 988f3fa was ada7108, checked in by Filip Chorbeski <86695898+FilipChorbeski@…>, 19 months ago |
change ids from int to Integer
Co-Authored-By: SazdovaEkaterina <74919977+SazdovaEkaterina@…>
|
-
Property mode
set to
100644
|
File size:
774 bytes
|
Line | |
---|
1 | package finki.paw5.model.entities;
|
---|
2 |
|
---|
3 | import finki.paw5.model.enumerations.FoodType;
|
---|
4 | import jakarta.persistence.*;
|
---|
5 | import lombok.Data;
|
---|
6 |
|
---|
7 | @Data
|
---|
8 | @Entity
|
---|
9 | @Table(name = "food")
|
---|
10 | public class Food {
|
---|
11 |
|
---|
12 | @Id
|
---|
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
14 | @Column(name = "id_food")
|
---|
15 | private Integer id;
|
---|
16 |
|
---|
17 | @Column(name = "manufacturer", nullable = false, length = 100)
|
---|
18 | private String manufacturer;
|
---|
19 |
|
---|
20 | @Column(name = "name_food", nullable = false, length = 20)
|
---|
21 | private String name;
|
---|
22 |
|
---|
23 | @Column(name = "type_food", nullable = false)
|
---|
24 | private FoodType type;
|
---|
25 |
|
---|
26 | public Food(String manufacturer, String name, FoodType type) {
|
---|
27 | this.manufacturer = manufacturer;
|
---|
28 | this.name = name;
|
---|
29 | this.type = type;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public Food() {
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.