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

	@NotNull(message = "Kategory Diet tidak boleh kosong")
	@Column(name = "KategoryDiet", nullable = false, length = 30)
	@Caption(value = "Kategory Diet")
	private String kategoryDiet;

	@NotNull(message = "Kd Kategory Diet tidak boleh kosong")
	@Column(name = "KdKategoryDiet", nullable = false)
	@Caption(value = "Kode Kategory Diet")
	private Byte kdKategoryDiet;

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

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

	@NotNull(message = "QKategory Diet tidak boleh kosong")
	@Column(name = "QKategoryDiet", nullable = false)
	@Caption(value = "QKategory Diet")
	private Byte qKategoryDiet;

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

}