Files
NTO-2025-Backend-TeamTask/src/main/java/com/example/nto/entity/Booking.java

43 lines
1.2 KiB
Java

package com.example.nto.entity;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import java.time.LocalDate;
@Entity
@Table(name = "booking")
@JsonIgnoreProperties({"hibernateLazyInitializer"})
public class Booking {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
private LocalDate date;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "place_id")
private Place place;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "employee_id")
private Employee employee;
public Booking() {}
public Booking(Employee employee, Place place, LocalDate date) {
this.employee = employee;
this.place = place;
this.date = date;
}
public long getId() { return id; }
public void setId(long id) { this.id = id; }
public LocalDate getDate() { return date; }
public void setDate(LocalDate date) { this.date = date; }
public Place getPlace() { return place; }
public void setPlace(Place place) { this.place = place; }
public Employee getEmployee() { return employee; }
public void setEmployee(Employee employee) { this.employee = employee; }
}