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 KomponenScore
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "KomponenScore_M")
public class KomponenScore extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectKomponenKlinisFk")
	@Caption(value = "Object Komponen Klinis")
	private KomponenKlinis komponenKlinis;

	@Column(name = "ObjectKomponenKlinisFk", insertable = false, updatable = false)
	private Integer komponenKlinisId;

	@NotNull(message = "Kd Komponen Score tidak boleh kosong")
	@Column(name = "KdKomponenScore", nullable = false)
	@Caption(value = "Kode Komponen Score")
	private Short kdKomponenScore;

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

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

	@NotNull(message = "Komponen Score tidak boleh kosong")
	@Column(name = "KomponenScore", nullable = false, length = 30)
	@Caption(value = "Komponen Score")
	private String komponenScore;

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

	@NotNull(message = "QKomponen Score tidak boleh kosong")
	@Column(name = "QKomponenScore", nullable = false)
	@Caption(value = "QKomponen Score")
	private Short qKomponenScore;

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

}