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.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class MapPaketToProduk
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "MapPaketToProduk_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class MapPaketToProduk extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectPaketFk")
	@NotNull(message = "Kd Paket tidak boleh kosong")

	@Caption(value = "Object Paket")
	private Paket paket;

	public void setPaket(Paket paket) {
		this.paket = paket;
	}

	public Paket getPaket() {
		return this.paket;
	}

	@Column(name = "ObjectPaketFk", insertable = false, updatable = false)
	private Integer paketId;

	@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;

	@Column(name = "QtyProduk", nullable = true)
	@Caption(value = "Qty Produk")
	private Double qtyProduk;

	public void setqtyProduk(Double qtyProduk) {
		this.qtyProduk = qtyProduk;
	}

	public Double getqtyProduk() {
		return this.qtyProduk;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectSatuanFk")
	@NotNull(message = "Satuan tidak boleh kosong")
	@Caption(value = "Object Satuan")
	private SatuanStandar satuan;

	@Column(name = "ObjectSatuanFk", insertable = false, updatable = false, nullable = false)
	private Integer satuanId;

	public SatuanStandar getSatuan() {
		return satuan;
	}

	public void setSatuan(SatuanStandar satuan) {
		this.satuan = satuan;
	}

	public Double getQtyProduk() {
		return qtyProduk;
	}

	public void setQtyProduk(Double qtyProduk) {
		this.qtyProduk = qtyProduk;
	}

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

	public Integer getId() {

		return id;
	}

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