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

	@ManyToOne
	@JoinColumn(name = "ObjectKelompokProdukFk")
	@Caption(value = "Object Kelompok Produk")
	private KelompokProduk kelompokProduk;

	@Column(name = "ObjectKelompokProdukFk", insertable = false, updatable = false)
	private Integer kelompokProdukId;

	@NotNull(message = "Kd Keterangan Diet tidak boleh kosong")
	@Column(name = "KdKeteranganDiet", nullable = false)
	@Caption(value = "Kode Keterangan Diet")
	private Byte kdKeteranganDiet;

	@NotNull(message = "Keterangan Diet tidak boleh kosong")
	@Column(name = "KeteranganDiet", nullable = false, length = 50)
	@Caption(value = "Keterangan Diet")
	private String keteranganDiet;

	@NotNull(message = "No Urut tidak boleh kosong")
	@Column(name = "NoUrut", nullable = false)
	@Caption(value = "No Urut")
	private Byte noUrut;

	@NotNull(message = "QKeterangan Diet tidak boleh kosong")
	@Column(name = "QKeteranganDiet", nullable = false)
	@Caption(value = "QKeterangan Diet")
	private Byte qKeteranganDiet;

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

}