source: src/main/java/com/example/villadihovo/model/reservations/Reservation.java@ f7c05a1

Last change on this file since f7c05a1 was f7c05a1, checked in by Elena Shulevska <elena.shulevska@…>, 15 months ago

initial commit of the source code on origin

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package com.example.villadihovo.model.reservations;
2
3import com.example.villadihovo.model.payments.Payment;
4import com.example.villadihovo.model.offers.Rooms;
5import com.example.villadihovo.model.offers.Villa;
6import jakarta.persistence.*;
7import lombok.AllArgsConstructor;
8import lombok.Data;
9import lombok.NoArgsConstructor;
10import org.hibernate.annotations.OnDelete;
11import org.hibernate.annotations.OnDeleteAction;
12
13import java.time.LocalDate;
14
15@AllArgsConstructor
16@NoArgsConstructor
17@Entity
18@Data
19@Table(name="reservation")
20public class Reservation {
21
22 @Id
23 @GeneratedValue(strategy = GenerationType.IDENTITY)
24 private int reservation_id;
25
26 @Column(nullable = false)
27 private LocalDate start_date;
28
29 @Column(nullable = false)
30 private LocalDate end_date;
31
32 @Column(nullable = false)
33 private int number_guests;
34
35 @Column(nullable = false)
36 private int adults;
37
38 @Column(nullable = true)
39 private int children;
40
41 @ManyToOne
42 @JoinColumn(name = "villa_id", nullable = false)
43 private Villa villa_id;
44
45 @ManyToOne
46 @JoinColumn(name = "payment_id", nullable = false)
47 private Payment payment_id;
48
49 @ManyToOne
50 @JoinColumn(name = "room_id", nullable = false)
51 private Rooms room_id;
52}
Note: See TracBrowser for help on using the repository browser.