main
Last change
on this file since c049fd6 was c049fd6, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 13 months ago |
specify project schema in the backend
|
-
Property mode
set to
100644
|
File size:
610 bytes
|
Line | |
---|
1 | package finki.paw5.model.relations;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import lombok.Data;
|
---|
5 | import lombok.RequiredArgsConstructor;
|
---|
6 |
|
---|
7 | @Data
|
---|
8 | @Entity
|
---|
9 | @RequiredArgsConstructor
|
---|
10 | @Table(name = "pet_belongs_to_category", schema = "project")
|
---|
11 | @IdClass(PetBelongsToCategoryId.class)
|
---|
12 | public class PetBelongsToCategory {
|
---|
13 |
|
---|
14 | @Id
|
---|
15 | @Column(name="id_pet", nullable = false)
|
---|
16 | private Integer petId;
|
---|
17 |
|
---|
18 | @Id
|
---|
19 | @Column(name="id_category", nullable = false)
|
---|
20 | private Integer categoryId;
|
---|
21 |
|
---|
22 | public PetBelongsToCategory(int petId, int categoryId) {
|
---|
23 | this.petId = petId;
|
---|
24 | this.categoryId = categoryId;
|
---|
25 | }
|
---|
26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.