source:
Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Post.java@
104185f
Last change on this file since 104185f was 95dd50a, checked in by , 16 months ago | |
---|---|
|
|
File size: 1.1 KB |
Rev | Line | |
---|---|---|
[3d3e59d] | 1 | package finki.paw5.model.entities; |
[d427a07] | 2 | |
[038c9f7] | 3 | import jakarta.persistence.*; |
[d427a07] | 4 | import lombok.Data; |
[fdd7961] | 5 | import lombok.RequiredArgsConstructor; |
[d427a07] | 6 | |
[fdfc6fa] | 7 | import java.time.LocalDate; |
[d427a07] | 8 | |
9 | @Data | |
10 | @Entity | |
[fdd7961] | 11 | @RequiredArgsConstructor |
[d427a07] | 12 | @Table(name = "post") |
13 | public class Post { | |
14 | ||
15 | @Id | |
[038c9f7] | 16 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
[d427a07] | 17 | @Column(name = "id_post") |
[ada7108] | 18 | private Integer id; |
[d427a07] | 19 | |
20 | @Column(name="date_post", nullable = false) | |
[fdfc6fa] | 21 | private LocalDate dateCreated; |
[d427a07] | 22 | |
23 | @Column(name="url_thumbanail", length = 200) | |
24 | private String thumbnailUrl; | |
25 | ||
[95dd50a] | 26 | @OneToOne |
[fdd7961] | 27 | @JoinColumn(name="id_pet", nullable = false) |
28 | private Pet pet; | |
[d427a07] | 29 | |
[fdd7961] | 30 | @ManyToOne |
31 | @JoinColumn(name="id_surendee") | |
32 | private Surendee surendeePoster; | |
[d427a07] | 33 | |
[fdd7961] | 34 | @ManyToOne |
35 | @JoinColumn(name="id_employee") | |
36 | private Employee employeePoster; | |
[d427a07] | 37 | |
[fdd7961] | 38 | public Post(LocalDate dateCreated, String thumbnailUrl, |
39 | Pet pet, Surendee surendeePoster, Employee employeePoster) { | |
[d427a07] | 40 | this.dateCreated = dateCreated; |
41 | this.thumbnailUrl = thumbnailUrl; | |
[fdd7961] | 42 | this.pet = pet; |
43 | this.surendeePoster = surendeePoster; | |
44 | this.employeePoster = employeePoster; | |
[d427a07] | 45 | } |
46 | } |
Note:
See TracBrowser
for help on using the repository browser.