main
Last change
on this file since 4885da3 was fdfc6fa, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 19 months ago |
change to LocalDate
Date (Java) was incompatible with date (postgresql) because it expected a timestamp type, not date
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | package finki.paw5.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.Column;
|
---|
4 | import jakarta.persistence.Entity;
|
---|
5 | import jakarta.persistence.Id;
|
---|
6 | import jakarta.persistence.Table;
|
---|
7 | import lombok.Data;
|
---|
8 |
|
---|
9 | import java.time.LocalDate;
|
---|
10 | import java.util.Date;
|
---|
11 |
|
---|
12 | @Data
|
---|
13 | @Entity
|
---|
14 | @Table(name = "post")
|
---|
15 | public class Post {
|
---|
16 |
|
---|
17 | @Id
|
---|
18 | @Column(name = "id_post")
|
---|
19 | private int id;
|
---|
20 |
|
---|
21 | @Column(name="date_post", nullable = false)
|
---|
22 | private LocalDate dateCreated;
|
---|
23 |
|
---|
24 | @Column(name="url_thumbanail", length = 200)
|
---|
25 | private String thumbnailUrl;
|
---|
26 |
|
---|
27 | @Column(name="id_pet", nullable = false)
|
---|
28 | private int petId;
|
---|
29 |
|
---|
30 | @Column(name="id_surendee")
|
---|
31 | private int surendeeId;
|
---|
32 |
|
---|
33 | @Column(name="id_employee")
|
---|
34 | private int employeeId;
|
---|
35 |
|
---|
36 | public Post(LocalDate dateCreated, String thumbnailUrl, int petId, int surendeeId, int employeeId) {
|
---|
37 | this.dateCreated = dateCreated;
|
---|
38 | this.thumbnailUrl = thumbnailUrl;
|
---|
39 | this.petId = petId;
|
---|
40 | this.surendeeId = surendeeId;
|
---|
41 | this.employeeId = employeeId;
|
---|
42 | }
|
---|
43 |
|
---|
44 | public Post() {
|
---|
45 | }
|
---|
46 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.