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

	@NotNull(message = "Stat tidak boleh kosong")
	@Column(name = "Stat", nullable = false, length = 100)
	@Caption(value = "Stat")
	private String stat;

	@NotNull(message = "Name tidak boleh kosong")
	@Column(name = "Name", nullable = false)
	@Caption(value = "Name")
	private String name;

	@Column(name = "Nilai")
	@Caption(value = "Nilai")
	private Integer nilai;

	@ManyToOne
	@JoinColumn(name = "ObjectpertanyaanSkriningGiziFk")
	private DataPertanyaanSkriningGizi dataPertanyaanSkriningGizi;

	@Column(name = "ObjectpertanyaanSkriningGiziFk", insertable = false, updatable = false)
	private Integer dataPertanyaanSkriningGiziId;

	@Column(name = "kategori", nullable = false, length = 1)
	@Caption(value = "kategori")
	private String kategori;

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

}