source: Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Adoption.java@ 9a180fd

main
Last change on this file since 9a180fd was 9a180fd, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 17 months ago

adopt a pet button + save adoption to db

  • Property mode set to 100644
File size: 922 bytes
Line 
1package finki.paw5.model.entities;
2
3import jakarta.persistence.*;
4import lombok.Data;
5
6import java.time.LocalDate;
7
8@Data
9@Entity
10@Table(name = "adoption")
11public class Adoption {
12
13 @Id
14 @GeneratedValue(strategy = GenerationType.IDENTITY)
15 @Column(name = "id_adoption")
16 private Integer id;
17
18 @Column(name = "start_date", nullable = false)
19 private LocalDate startDate;
20
21 @Column(name = "end_date_foster")
22 private LocalDate endDateFoster;
23
24 @Column(name = "approved", nullable = false)
25 private boolean approved;
26
27 @Column(name = "id_adopter", nullable = false)
28 private Integer adopterId;
29
30 public Adoption(LocalDate startDate, LocalDate endDateFoster, boolean approved, Integer adopterId) {
31 this.startDate = startDate;
32 this.endDateFoster = endDateFoster;
33 this.approved = approved;
34 this.adopterId = adopterId;
35 }
36
37 public Adoption() {
38 }
39}
Note: See TracBrowser for help on using the repository browser.