package com.jasamedika.medifirst2000.entities;

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

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

import static javax.persistence.CascadeType.ALL;
import static javax.persistence.FetchType.EAGER;
import static javax.persistence.GenerationType.SEQUENCE;

/**
 * class KelompokShift
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "sdm_KelompokShift_M")
public class KelompokShift extends BaseMaster {

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

	@JsonBackReference
	@OneToMany(cascade = ALL, fetch = EAGER, mappedBy = "kelompokShift")
	private Set<ShiftKerja> detail = new HashSet<>();

	@Column(name = "Kode", nullable = false, length = 100)
	@Caption(value = "Kode")
	private Integer kode;

	@Column(name = "Name", nullable = false, length = 100)
	@Caption(value = "Name")
	private String name;

	@Column(name = "KdKelompokShiftKerja")
	@Caption(value = "Kd Kelompok Shift Kerja")
	private Integer kdKelompokShiftKerja;

	@Column(name = "KelompokShiftKerja", length = 30)
	@Caption(value = "Kelompok Shift Kerja")
	private String kelompokShiftKerja;

	@Column(name = "FactorRate")
	@Caption(value = "Factor Rate")
	private Integer factorRate;

	@Column(name = "OperatorFactorRate")
	@Caption(value = "Operator Factor Rate")
	private String operatorFactorRate;

	@Column(name = "QKelompokShift")
	@Caption(value = "Q Kelompo kShift")
	private Integer qKelompokShift;

}