source: Prototype Application/Paw5/src/main/java/finki/paw5/model/Post.java@ fdfc6fa

main
Last change on this file since fdfc6fa was fdfc6fa, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 17 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 
1package finki.paw5.model;
2
3import jakarta.persistence.Column;
4import jakarta.persistence.Entity;
5import jakarta.persistence.Id;
6import jakarta.persistence.Table;
7import lombok.Data;
8
9import java.time.LocalDate;
10import java.util.Date;
11
12@Data
13@Entity
14@Table(name = "post")
15public 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.