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

	@NotNull(message = "Kd Alergi tidak boleh kosong")
	@Column(name = "KdAlergi", nullable = false)
	@Caption(value = "Kode Alergi")
	private short kdAlergi;

	@Caption(value = "Nama Alergi")
	@NotNull(message = "Nama Alergi tidak boleh kosong")
	@Column(name = "NamaAlergi", nullable = false, length = 25)
	private String namaAlergi;

	@NotNull(message = "QAlergi tidak boleh kosong")
	@Column(name = "QAlergi", nullable = false)
	@Caption(value = "QAlergi")
	private short qAlergi;

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

}