main
Last change
on this file since 30ab9cc was c049fd6, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 13 months ago |
specify project schema in the backend
|
-
Property mode
set to
100644
|
File size:
752 bytes
|
Rev | Line | |
---|
[d427a07] | 1 | package finki.paw5.model.relations;
|
---|
| 2 |
|
---|
[4846b7a] | 3 | import jakarta.persistence.*;
|
---|
[d427a07] | 4 | import lombok.Data;
|
---|
[d1fe9c2] | 5 | import lombok.RequiredArgsConstructor;
|
---|
[d427a07] | 6 |
|
---|
| 7 | @Data
|
---|
| 8 | @Entity
|
---|
[d1fe9c2] | 9 | @RequiredArgsConstructor
|
---|
[c049fd6] | 10 | @Table(name = "pet_preferably_eats_food", schema = "project")
|
---|
[4846b7a] | 11 | @IdClass(PetPreferablyEatsFoodId.class)
|
---|
[d427a07] | 12 | public class PetPreferablyEatsFood {
|
---|
| 13 |
|
---|
| 14 | @Id
|
---|
| 15 | @Column(name = "id_pet", nullable = false)
|
---|
[ada7108] | 16 | private Integer petId;
|
---|
[d427a07] | 17 |
|
---|
| 18 | @Id
|
---|
| 19 | @Column(name = "id_food", nullable = false)
|
---|
[ada7108] | 20 | private Integer foodId;
|
---|
[d427a07] | 21 |
|
---|
| 22 | @Column(name = "quantity_a_day", nullable = false)
|
---|
| 23 | private int quantityPerDay;
|
---|
| 24 |
|
---|
| 25 | public PetPreferablyEatsFood(int petId, int foodId, int quantityPerDay) {
|
---|
| 26 | this.petId = petId;
|
---|
| 27 | this.foodId = foodId;
|
---|
| 28 | this.quantityPerDay = quantityPerDay;
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.