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

import static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "DetailKajianEvaluasi_M")
public class DetailKajianEvaluasi extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectTujuanFk")
	@NotNull(message = "Tujuan tidak boleh kosong")
	@Caption(value = "Tujuan")
	private Jabatan tujuan;

	@Column(name = "ObjectTujuanFk", insertable = false, updatable = false, nullable = false)
	private Integer tujuanId;

	@Column(name = "statusUsulan")
	@Caption(value = "Status Usulan")
	private String statusUsulan;

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

	@ManyToOne
	@JoinColumn(name = "ObjectKajianEvaluasiFk")
	@NotNull(message = "Kajian Evaluasi tidak boleh kosong")
	@Caption(value = "Kajian Evaluasi")
	private KajianEvaluasi kajianEvaluasi;

	@Column(name = "ObjectKajianEvaluasiFk", insertable = false, updatable = false, nullable = false)
	private Integer kajianId;

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

}