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

	@Column(name = "detailindikator", nullable = false)
	@Caption(value = "Detail Indikator")
	private String detailIndikator;

	@ManyToOne
	@NotNull(message = "Indikator kinerja tidak boleh kosong")
	@JoinColumn(name = "objectindikatorkinerjafk")
	@Caption(value = "Indikator Kinerja")
	private IndikatorKinerja indikatorKinerja;

	@Column(name = "objectindikatorkinerjafk", insertable = false, updatable = false)
	private Integer indikatorKinerjaId;

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

}
