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

	@NotNull(message = "Infeksi Nosokomial tidak boleh kosong")
	@Column(name = "InfeksiNosokomial", nullable = false, length = 50)
	@Caption(value = "Infeksi Nosokomial")
	private String infeksiNosokomial;

	@NotNull(message = "Kd Infeksi Nosokomial tidak boleh kosong")
	@Column(name = "KdInfeksiNosokomial", nullable = false, length = 2)
	@Caption(value = "Kode Infeksi Nosokomial")
	private String kdInfeksiNosokomial;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisInfeksiNosokomialFk")
	@NotNull(message = "Kd Jenis Infeksi Nosokomial tidak boleh kosong")

	@Caption(value = "Object Jenis Infeksi Nosokomial")
	private JenisInfeksiNosokomial jenisInfeksiNosokomial;

	@Column(name = "ObjectJenisInfeksiNosokomialFk", insertable = false, updatable = false)
	private Integer jenisInfeksiNosokomialId;

	@NotNull(message = "QInfeksi Nosokomial tidak boleh kosong")
	@Column(name = "QInfeksiNosokomial", nullable = false)
	@Caption(value = "QInfeksi Nosokomial")
	private Byte qInfeksiNosokomial;

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

}