package com.itsol.quantrivanphong.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "employee_role")
public class EmployeeRole {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false, unique = true)
    private int id;

    @Column(name = "licensed", nullable = false)
    private boolean licensed;

    //    @JsonIgnore
    @ManyToOne(fetch = FetchType.EAGER)
    private Employee employee;

    //    @JsonIgnore
    @ManyToOne(fetch = FetchType.EAGER)
    private Role role;
}
