package com.example.nto.entity; import com.fasterxml.jackson.annotation.JsonIgnore; import jakarta.persistence.*; import java.util.ArrayList; import java.util.List; @Entity @Table(name = "employee") public class Employee { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; private String name; @Column(unique = true) private String code; private String photoUrl; @OneToMany(mappedBy = "employee", cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JsonIgnore private List bookingList = new ArrayList<>(); public Employee() {} public Employee(String name, String code, String photoUrl) { this.name = name; this.code = code; this.photoUrl = photoUrl; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getPhotoUrl() { return photoUrl; } public void setPhotoUrl(String photoUrl) { this.photoUrl = photoUrl; } public List getBookingList() { return bookingList; } public void setBookingList(List bookingList) { this.bookingList = bookingList; } }