main
Last change
on this file since 579bf6d was d427a07, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 17 months ago |
add models and enums
|
-
Property mode
set to
100644
|
File size:
810 bytes
|
Rev | Line | |
---|
[d427a07] | 1 | package finki.paw5.model;
|
---|
| 2 |
|
---|
| 3 | import finki.paw5.model.enumerations.FoodType;
|
---|
| 4 | import jakarta.persistence.Column;
|
---|
| 5 | import jakarta.persistence.Entity;
|
---|
| 6 | import jakarta.persistence.Id;
|
---|
| 7 | import jakarta.persistence.Table;
|
---|
| 8 | import lombok.Data;
|
---|
| 9 |
|
---|
| 10 | @Data
|
---|
| 11 | @Entity
|
---|
| 12 | @Table(name = "food")
|
---|
| 13 | public class Food {
|
---|
| 14 |
|
---|
| 15 | @Id
|
---|
| 16 | @Column(name = "id_food")
|
---|
| 17 | private int id;
|
---|
| 18 |
|
---|
| 19 | @Column(name = "manufacturer", nullable = false, length = 100)
|
---|
| 20 | private String manufacturer;
|
---|
| 21 |
|
---|
| 22 | @Column(name = "name_food", nullable = false, length = 20)
|
---|
| 23 | private String name;
|
---|
| 24 |
|
---|
| 25 | @Column(name = "type_food", nullable = false)
|
---|
| 26 | private FoodType type;
|
---|
| 27 |
|
---|
| 28 | public Food(String manufacturer, String name, FoodType type) {
|
---|
| 29 | this.manufacturer = manufacturer;
|
---|
| 30 | this.name = name;
|
---|
| 31 | this.type = type;
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | public Food() {
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.