- Timestamp:
- 03/09/23 16:11:48 (16 months ago)
- Branches:
- main
- Children:
- 0078d84, 4ab3aae
- Parents:
- 8b7dd7f (diff), 264d675 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- SazdovaEkaterina <74919977+SazdovaEkaterina@…> (03/09/23 16:11:48)
- git-committer:
- GitHub <noreply@…> (03/09/23 16:11:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Post.java
r8b7dd7f rc3278ac 3 3 import jakarta.persistence.*; 4 4 import lombok.Data; 5 import lombok.RequiredArgsConstructor; 5 6 6 7 import java.time.LocalDate; … … 8 9 @Data 9 10 @Entity 11 @RequiredArgsConstructor 10 12 @Table(name = "post") 11 13 public class Post { … … 22 24 private String thumbnailUrl; 23 25 24 @Column(name="id_pet", nullable = false) 25 private Integer petId; 26 @OneToOne 27 @JoinColumn(name="id_pet", nullable = false) 28 private Pet pet; 26 29 27 @Column(name="id_surendee") 28 private Integer surendeeId; 30 @ManyToOne 31 @JoinColumn(name="id_surendee") 32 private Surendee surendeePoster; 29 33 30 @Column(name="id_employee") 31 private Integer employeeId; 34 @ManyToOne 35 @JoinColumn(name="id_employee") 36 private Employee employeePoster; 32 37 33 public Post(LocalDate dateCreated, String thumbnailUrl, Integer petId, Integer surendeeId, Integer employeeId) { 38 public Post(LocalDate dateCreated, String thumbnailUrl, 39 Pet pet, Surendee surendeePoster, Employee employeePoster) { 34 40 this.dateCreated = dateCreated; 35 41 this.thumbnailUrl = thumbnailUrl; 36 this.petId = petId; 37 this.surendeeId = surendeeId; 38 this.employeeId = employeeId; 39 } 40 41 public Post() { 42 this.pet = pet; 43 this.surendeePoster = surendeePoster; 44 this.employeePoster = employeePoster; 42 45 } 43 46 }
Note:
See TracChangeset
for help on using the changeset viewer.