source: Prototype Application/Paw5/src/main/java/finki/paw5/model/relations/PetPreferablyEatsFood.java@ 4846b7a

main
Last change on this file since 4846b7a was 4846b7a, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 17 months ago

fix composite keys

  • Property mode set to 100644
File size: 704 bytes
Line 
1package finki.paw5.model.relations;
2
3import jakarta.persistence.*;
4import lombok.Data;
5
6@Data
7@Entity
8@Table(name = "pet_preferably_eats_food")
9@IdClass(PetPreferablyEatsFoodId.class)
10public class PetPreferablyEatsFood {
11
12 @Id
13 @Column(name = "id_pet", nullable = false)
14 private int petId;
15
16 @Id
17 @Column(name = "id_food", nullable = false)
18 private int foodId;
19
20 @Column(name = "quantity_a_day", nullable = false)
21 private int quantityPerDay;
22
23 public PetPreferablyEatsFood(int petId, int foodId, int quantityPerDay) {
24 this.petId = petId;
25 this.foodId = foodId;
26 this.quantityPerDay = quantityPerDay;
27 }
28
29 public PetPreferablyEatsFood() {
30 }
31}
Note: See TracBrowser for help on using the repository browser.