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

	@ManyToOne
	@JoinColumn(name = "ObjectKomponenScoreFk")
	@NotNull(message = "Kd Komponen Score tidak boleh kosong")
	@Caption(value = "Object Komponen Score")
	private KomponenScore komponenScore;

	@Column(name = "ObjectKomponenScoreFk", insertable = false, updatable = false)
	private Integer komponenScoreId;

	@NotNull(message = "Nilai Maksimum tidak boleh kosong")
	@Column(name = "NilaiMaksimum", nullable = false)
	@Caption(value = "Nilai Maksimum")
	private Double nilaiMaksimum;

	@NotNull(message = "Nilai Minimum tidak boleh kosong")
	@Column(name = "NilaiMinimum", nullable = false)
	@Caption(value = "Nilai Minimum")
	private Double nilaiMinimum;

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

	@NotNull(message = "QRange Nilai tidak boleh kosong")
	@Column(name = "QRangeNilai", nullable = false)
	@Caption(value = "QRange Nilai")
	private short qRangeNilai;

	@NotNull(message = "Range Nilai tidak boleh kosong")
	@Column(name = "RangeNilai", nullable = false, length = 50)
	@Caption(value = "Range Nilai")
	private String rangeNilai;

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

}