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

	@Caption(value = "Nama Indikator Kualitas")
	@Column(name = "namaindikatorkualitas")
	private String namaIndikatorKualitas;

	@Caption(value = "Definisi Operasional")
	@Column(name = "definisioperasional")
	private String definisiOperasional;

	@Caption(value = "Persentase Target")
	@Column(name = "target")
	private Integer target;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "objecturaiankegiatanfk")
	@Caption(value = "Uraian Kegiatan")
	private UraianKegiatan uraianKegiatan;

	@Column(name = "objecturaiankegiatanfk", insertable = false, updatable = false)
	private Integer idUraianKegiatan;

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

}
