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 javax.validation.constraints.NotNull;

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

/**
 * class KomponenEvaluasi
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "KomponenEvaluasi_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class KomponenEvaluasi extends BaseMaster {

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "jabatanFK")
	@Caption(value = "jabatan")
	private Jabatan jabatan;

	@Column(name = "jabatanFK", insertable = false, updatable = false)
	private Integer jabatanId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "kelompokEvaluasiFK")
	@Caption(value = "kelompokEvaluasi")
	private KelompokEvaluasi kelompokEvaluasi;

	@Column(name = "kelompokEvaluasiFK", insertable = false, updatable = false)
	private Integer kdKelompokEvaluasiId;

	@Caption(value = "nilaiMin")
	@Column(name = "nilaiMin")
	private Double nilaiMin;

	@Caption(value = "nilaiMax")
	@Column(name = "nilaiMax")
	private Double nilaiMax;

	@Caption(value = "nilaiStandar")
	@Column(name = "nilaiStandar")
	private String nilaiStandar;

	@Caption(value = "deskripsiKompetensi")
	@Column(name = "deskripsiKompetensi", length = 9000)
	private String deskripsiKompetensi;

	@Caption(value = "factorRate")
	@Column(name = "factorRate", nullable = false)
	private Double factorRate;

	@Caption(value = "operatorFactorRate")
	@Column(name = "operatorFactorRate")
	private String operatorFactorRate;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Kd Departemen tidak boleh kosong")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

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

	@NotNull(message = "Kd Komponen Evaluasi tidak boleh kosong")
	@Column(name = "KdKomponenEvaluasi", nullable = false)
	@Caption(value = "Kode Komponen Evaluasi")
	private Integer kdKomponenEvaluasi;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectKomponenEvaluasiHeadFk")
	@Caption(value = "Object Komponen Evaluasi Head")
	private KomponenEvaluasi komponenEvaluasiHead;

	@Column(name = "ObjectKomponenEvaluasiHeadFk", insertable = false, updatable = false, nullable = false)
	private Integer komponenEvaluasiHeadId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectSatuanHasilFk")
	@Caption(value = "Object Satuan Hasil")
	private SatuanHasil satuanHasil;

	@Column(name = "ObjectSatuanHasilFk", insertable = false, updatable = false)
	private Integer satuanHasilId;

	@NotNull(message = "Komponen Evaluasi tidak boleh kosong")
	@Column(name = "KomponenEvaluasi", nullable = false, length = 75)
	@Caption(value = "Komponen Evaluasi")
	private String komponenEvaluasi;

	@Column(name = "NilaiNormal", length = 150)
	@Caption(value = "Nilai Normal")
	private String nilaiNormal;

	@NotNull(message = "No Urut tidak boleh kosong")
	@Column(name = "NoUrut", nullable = false)
	@Caption(value = "No Urut")
	private Integer noUrut;

	@NotNull(message = "QKomponen Evaluasi tidak boleh kosong")
	@Column(name = "QKomponenEvaluasi", nullable = false)
	@Caption(value = "QKomponen Evaluasi")
	private Integer qKomponenEvaluasi;

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

}