main
Last change
on this file since 468b7b6 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
|
Rev | Line | |
---|
[3d3e59d] | 1 | package finki.paw5.model.entities;
|
---|
[d427a07] | 2 |
|
---|
| 3 | import finki.paw5.model.enumerations.FoodType;
|
---|
[038c9f7] | 4 | import jakarta.persistence.*;
|
---|
[d427a07] | 5 | import lombok.Data;
|
---|
| 6 |
|
---|
| 7 | @Data
|
---|
| 8 | @Entity
|
---|
| 9 | @Table(name = "food")
|
---|
| 10 | public class Food {
|
---|
| 11 |
|
---|
| 12 | @Id
|
---|
[038c9f7] | 13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
[d427a07] | 14 | @Column(name = "id_food")
|
---|
[ada7108] | 15 | private Integer id;
|
---|
[d427a07] | 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.