package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import javax.persistence.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.jasamedika.medifirst2000.base.BaseMaster;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.util.logging.Messages;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;

/**
 * class MapJenisDietToProduk
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "MapJenisDietToProduk_M")
public class MapJenisDietToProduk extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectJenisDietFk")
	@NotNull(message = "Kd JenisDiet tidak boleh kosong")

	@Caption(value = "Object Jenis Diet")
	private JenisDiet JenisDiet;

	public void setJenisDiet(JenisDiet JenisDiet) {
		this.JenisDiet = JenisDiet;
	}

	public JenisDiet getJenisDiet() {
		return this.JenisDiet;
	}

	@Column(name = "ObjectJenisDietFk", insertable = false, updatable = false)
	private Integer JenisDietId;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")
	@NotNull(message = "Kd Produk tidak boleh kosong")

	@Caption(value = "Object Produk")
	private Produk produk;

	public void setProduk(Produk produk) {
		this.produk = produk;
	}

	public Produk getProduk() {
		return this.produk;
	}

	@Column(name = "ObjectProdukFk", insertable = false, updatable = false, nullable = false)
	private Integer produkId;

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

	public Integer getId() {

		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name="Berat", length=10)
	private String berat;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="ObjectJenisWaktuFk")
	private JenisWaktu jenisWaktu;
	
	@Column(name="ObjectJenisWaktuFk", insertable=false, updatable=false)
	private Integer jenisWaktuId;
	
	public String getBerat() {
		return berat;
	}

	public void setBerat(String berat) {
		this.berat = berat;
	}

	public Integer getJenisDietId() {
		return JenisDietId;
	}

	public void setJenisDietId(Integer jenisDietId) {
		JenisDietId = jenisDietId;
	}

	public Integer getProdukId() {
		return produkId;
	}

	public void setProdukId(Integer produkId) {
		this.produkId = produkId;
	}

	public JenisWaktu getJenisWaktu() {
		return jenisWaktu;
	}

	public void setJenisWaktu(JenisWaktu jenisWaktu) {
		this.jenisWaktu = jenisWaktu;
	}

	public Integer getJenisWaktuId() {
		return jenisWaktuId;
	}

	public void setJenisWaktuId(Integer jenisWaktuId) {
		this.jenisWaktuId = jenisWaktuId;
	}
	
	
	
	
}