package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
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 = "KelompokEvaluasi_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class KelompokEvaluasi extends BaseMaster {

	@Caption(value = "kdKelompokEvaluasi")
	@Column(name = "kdKelompokEvaluasi", nullable = false)
	private Integer kdKelompokEvaluasi;

	@Caption(value = "kelompokEvaluasi")
	@Column(name = "kelompokEvaluasi", nullable = false)
	private String kelompokEvaluasi;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "kdKelompokEvaluasiHeadFK")
	@Caption(value = "kdKelompokEvaluasiHead")
	private KelompokEvaluasi kdKelompokEvaluasiHead;

	@Column(name = "kdKelompokEvaluasiHeadFK", insertable = false, updatable = false)
	private Integer kdKelompokEvaluasiHeadId;

	@Caption(value = "noUrut")
	@Column(name = "noUrut", nullable = false)
	private Integer noUrut;

	@Caption(value = "keteranganLainnya")
	@Column(name = "keteranganLainnya", length = 300)
	private String keteranganLainnya;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "DepartemenFK")
	@Caption(value = "Departemen")
	private Departemen departemen;

	@Column(name = "DepartemenFK", insertable = false, updatable = false)
	private Integer departemenId;

	@Caption(value = "qKelompokEvaluasi")
	@Column(name = "qKelompokEvaluasi", nullable = false)
	private Integer qKelompokEvaluasi;

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

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "PendidikanFK")
	@Caption(value = "Pendidikan")
	private Pendidikan pendidikan;

	@Column(name = "PendidikanFK", insertable = false, updatable = false)
	private Integer pendidikanId;

	@Column(name = "Pengalaman")
	@Caption("Deskripsi Pengalaman")
	private String pengalaman;

	@Column(name = "Pelatihan")
	@Caption("Deskripsi Pelatihan")
	private String pelatihan;

}
