[f7c05a1] | 1 | package com.example.villadihovo.model.reservations;
|
---|
| 2 |
|
---|
| 3 | import com.example.villadihovo.model.payments.Payment;
|
---|
| 4 | import com.example.villadihovo.model.offers.Rooms;
|
---|
| 5 | import com.example.villadihovo.model.offers.Villa;
|
---|
| 6 | import jakarta.persistence.*;
|
---|
| 7 | import lombok.AllArgsConstructor;
|
---|
| 8 | import lombok.Data;
|
---|
| 9 | import lombok.NoArgsConstructor;
|
---|
| 10 | import org.hibernate.annotations.OnDelete;
|
---|
| 11 | import org.hibernate.annotations.OnDeleteAction;
|
---|
| 12 |
|
---|
| 13 | import java.time.LocalDate;
|
---|
| 14 |
|
---|
| 15 | @AllArgsConstructor
|
---|
| 16 | @NoArgsConstructor
|
---|
| 17 | @Entity
|
---|
| 18 | @Data
|
---|
| 19 | @Table(name="reservation")
|
---|
| 20 | public 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 | } |
---|