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

	@NotNull(message = "Kd Keadaan Lahir Bayi tidak boleh kosong")
	@Column(name = "KdKeadaanLahirBayi", nullable = false, length = 2)
	@Caption(value = "Kode Keadaan Lahir Bayi")
	private String kdKeadaanLahirBayi;

	@ManyToOne
	@JoinColumn(name = "ObjectKuantitasLahirBayiFk")
	@NotNull(message = "Kd Kuantitas Lahir Bayi tidak boleh kosong")
	@Caption(value = "Object Kuantitas Lahir Bayi")
	private KuantitasLahirBayi kuantitasLahirBayi;

	@Column(name = "ObjectKuantitasLahirBayiFk", insertable = false, updatable = false)
	private Integer kuantitasLahirBayiId;

	@NotNull(message = "Keadaan Lahir Bayi tidak boleh kosong")
	@Column(name = "KeadaanLahirBayi", nullable = false, length = 30)
	@Caption(value = "Keadaan Lahir Bayi")
	private String keadaanLahirBayi;

	@NotNull(message = "QKeadaan Lahir Bayi tidak boleh kosong")
	@Column(name = "QKeadaanLahirBayi", nullable = false)
	@Caption(value = "QKeadaan Lahir Bayi")
	private Byte qKeadaanLahirBayi;

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

}