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

	@NotNull(message = "Cara Masak tidak boleh kosong")
	@Column(name = "CaraMasak", nullable = false, length = 300)
	@Caption(value = "Cara Masak")
	private String caraMasak;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukMDFk")
	@NotNull(message = "Kd Produk M D tidak boleh kosong")
	@Caption(value = "Object Produk M D")
	private Produk produkMD;

	@Column(name = "ObjectProdukMDFk", insertable = false, updatable = false)
	private Integer produkMDId;

	@Column(name = "KeteranganLainnya", length = 150)
	@Caption(value = "Keterangan Lainnya")
	private String keteranganLainnya;

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

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

}