package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
@Table(name = "MapProdukMenuToBahan_M")
public class MapProdukMenuToBahan extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectMenuProdukFK")
	@NotNull(message = "Menu Produk tidak boleh kosong")
	@Caption(value = "Menu Produk")
	private Produk menuProduk;

	@Column(name = "ObjectMenuProdukFK", insertable = false, updatable = false, nullable = false)
	private Integer menuProdukId;

	@ManyToOne
	@JoinColumn(name = "ObjectBahanProdukFK")
	@NotNull(message = "Bahan Produk tidak boleh kosong")
	@Caption(value = "Bahan Produk")
	private Produk bahanProduk;

	@Column(name = "ObjectBahanProdukFK", insertable = false, updatable = false, nullable = false)
	private Integer bahanProdukId;

	@Column(name = "standarPorsi", nullable = true)
	@Caption(value = "Standar Porsi")
	private Double standarPorsi;

	@ManyToOne
	@JoinColumn(name = "ObjectSatuanStandarFK")
	@NotNull(message = "Satuan Standar tidak boleh kosong")
	@Caption(value = "Satuan Standar")
	private SatuanStandar satuanStandar;

	@Column(name = "ObjectSatuanStandarFK", insertable = false, updatable = false, nullable = false)
	private Integer satuanStandarId;

	@Column(name = "keterangan", nullable = true)
	@Caption(value = "Keterangan")
	private String keterangan;

	@ManyToOne
	@JoinColumn(name = "ObjectKelasFK")
	@Caption(value = "kelas")
	private Kelas kelas;

	@Column(name = "ObjectKelasFK", insertable = false, updatable = false, nullable = true)
	private Integer kelasId;

	public Produk getMenuProduk() {
		return menuProduk;
	}

	public void setMenuProduk(Produk menuProduk) {
		this.menuProduk = menuProduk;
	}

	public Integer getMenuProdukId() {
		return menuProdukId;
	}

	public void setMenuProdukId(Integer menuProdukId) {
		this.menuProdukId = menuProdukId;
	}

	public Produk getBahanProduk() {
		return bahanProduk;
	}

	public void setBahanProduk(Produk bahanProduk) {
		this.bahanProduk = bahanProduk;
	}

	public Integer getBahanProdukId() {
		return bahanProdukId;
	}

	public void setBahanProdukId(Integer bahanProdukId) {
		this.bahanProdukId = bahanProdukId;
	}

	public Double getStandarPorsi() {
		return standarPorsi;
	}

	public void setStandarPorsi(Double standarPorsi) {
		this.standarPorsi = standarPorsi;
	}

	public SatuanStandar getSatuanStandar() {
		return satuanStandar;
	}

	public void setSatuanStandar(SatuanStandar satuanStandar) {
		this.satuanStandar = satuanStandar;
	}

	public Integer getSatuanStandarId() {
		return satuanStandarId;
	}

	public void setSatuanStandarId(Integer satuanStandarId) {
		this.satuanStandarId = satuanStandarId;
	}

	public String getKeterangan() {
		return keterangan;
	}

	public void setKeterangan(String keterangan) {
		this.keterangan = keterangan;
	}

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

	public Integer getId() {

		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Kelas getKelas() {
		return kelas;
	}

	public void setKelas(Kelas kelas) {
		this.kelas = kelas;
	}

	public Integer getKelasId() {
		return kelasId;
	}

	public void setKelasId(Integer kelasId) {
		this.kelasId = kelasId;
	}
	
}