package com.jasamedika.medifirst2000.entities;

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 = "MapKelompokShiftToShift_M")
public class MapKelompokShiftToShift extends BaseMaster {

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

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

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

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

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

}
