package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

import static javax.persistence.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "MapStatusPegawaiToShiftKerja_M")
public class MapStatusPegawaiToShiftKerja extends BaseMaster {

	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "public.mapStatusPegawaiToShiftKerja_m_id_seq")
	@SequenceGenerator(name = "public.mapStatusPegawaiToShiftKerja_m_id_seq", sequenceName = "public.mapStatusPegawaiToShiftKerja_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

	@Column(name = "ObjectStatusPegawaiFk", insertable = false, updatable = false)
	private Integer statusPegawaiId;

	@Column(name = "ObjectShiftKerjaFk", insertable = false, updatable = false)
	private Integer shiftKerjaId;

	@Column(name = "ObjectKelompokShiftFk", insertable = false, updatable = false)
	private Integer kelompokShiftId;

	@ManyToOne(fetch = LAZY)
	@JsonIgnore
	@JoinColumn(name = "ObjectStatusPegawaiFk")
	@Caption(value = "Object Status Pegawai")
	private StatusPegawai statusPegawai;

	@ManyToOne(fetch = LAZY)
	@JsonIgnore
	@JoinColumn(name = "ObjectShiftKerjaFk")
	@Caption(value = "Object Shift Kerja")
	private ShiftKerja shiftKerja;

	@ManyToOne(fetch = LAZY)
	@JsonIgnore
	@JoinColumn(name = "ObjectKelompokShiftFk")
	@Caption(value = "Object Kelompok Shift")
	private KelompokShift kelompokShift;

}
