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;

/**
 * class AsKepKajian
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "AsKepKajian_M")
public class AsKepKajian extends BaseMaster {

	@Column(name = "DeskripsiKajian", length = 150)
	@Caption(value = "Deskripsi Kajian")
	private String deskripsiKajian;

	@Column(name = "Kajian", length = 150)
	@Caption(value = "Kajian")
	private String kajian;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisKajianFk")
	@NotNull(message = "Kd Jenis Kajian tidak boleh kosong")
	@Caption(value = "Object Jenis Kajian")
	private AsKepJenisKajian jenisKajian;

	@Column(name = "ObjectJenisKajianFk", insertable = false, updatable = false)
	private Integer jenisKajianId;

	@NotNull(message = "Kd Kajian tidak boleh kosong")
	@Column(name = "KdKajian", nullable = false)
	@Caption(value = "Kode Kajian")
	private Integer kdKajian;

	@ManyToOne
	@JoinColumn(name = "ObjectKategoryKajianFk")
	@NotNull(message = "Kd Kategory Kajian tidak boleh kosong")
	@Caption(value = "Object Kategory Kajian")
	private AsKepKategoryKajian kategoryKajian;

	@Column(name = "ObjectKategoryKajianFk", insertable = false, updatable = false, nullable = false)
	private Integer kategoryKajianId;

	@NotNull(message = "Nilai Normal tidak boleh kosong")
	@Column(name = "NilaiNormal", nullable = false, length = 50)
	@Caption(value = "Nilai Normal")
	private String nilaiNormal;

	@NotNull(message = "QKajian tidak boleh kosong")
	@Column(name = "QKajian", nullable = false)
	@Caption(value = "QKajian")
	private Integer qKajian;

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

}