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 = "mapgeneriktoproduk_m")
public class MapGenerikToProduk extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectGenerikFk")
	@NotNull(message = "Generik tidak boleh kosong")
	@Caption(value = "Object Generik")
	private Generik generik;

	@Column(name = "ObjectGenerikFk", insertable = false, updatable = false, nullable = false)
	private Integer generikId;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")
	@NotNull(message = "Produk tidak boleh kosong")
	@Caption(value = "Object Produk")
	private Produk produk;

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

	@ManyToOne
	@JoinColumn(name = "ObjectSatuanDosisFk")
	@NotNull(message = "SatuanDosis tidak boleh kosong")
	@Caption(value = "Object SatuanDosis")
	private SatuanStandar satuanDosis;

	@Column(name = "ObjectSatuanDosisFk", insertable = false, updatable = false, nullable = false)
	private Integer satuanDosisId;

	@ManyToOne
	@JoinColumn(name = "ObjectSatuanSediaanFk")
	@NotNull(message = "Satuan Sediaan tidak boleh kosong")
	@Caption(value = "Object Satuan Sediaan")
	private Sediaan satuanSediaan;

	@Column(name = "ObjectSatuanSediaanFk", insertable = false, updatable = false, nullable = false)
	private Integer satuanSediaanId;

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

	@Column(name = "ObjectSatuanVolumeFk", insertable = false, updatable = false, nullable = false)
	private Integer satuanVolumeId;

	@Column(name = "kekuatanDosis", nullable = true)
	@Caption(value = "Kekuatan Dosis")
	private Double kekuatanDosis;

	@Column(name = "volume", nullable = true)
	@Caption(value = "Volume")
	private Double volume;

	public Generik getGenerik() {
		return generik;
	}

	public void setGenerik(Generik generik) {
		this.generik = generik;
	}

	public Produk getProduk() {
		return produk;
	}

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

	public SatuanStandar getSatuanDosis() {
		return satuanDosis;
	}

	public void setSatuanDosis(SatuanStandar satuanDosis) {
		this.satuanDosis = satuanDosis;
	}

	public SatuanStandar getSatuanVolume() {
		return satuanVolume;
	}

	public void setSatuanVolume(SatuanStandar satuanVolume) {
		this.satuanVolume = satuanVolume;
	}

	public Double getKekuatanDosis() {
		return kekuatanDosis;
	}

	public void setKekuatanDosis(Double kekuatanDosis) {
		this.kekuatanDosis = kekuatanDosis;
	}

	public Double getVolume() {
		return volume;
	}

	public void setVolume(Double volume) {
		this.volume = volume;
	}

	public Integer getGenerikId() {
		return generikId;
	}

	public void setGenerikId(Integer generikId) {
		this.generikId = generikId;
	}

	public Integer getProdukId() {
		return produkId;
	}

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

	public Integer getSatuanDosisId() {
		return satuanDosisId;
	}

	public void setSatuanDosisId(Integer satuanDosisId) {
		this.satuanDosisId = satuanDosisId;
	}

	public Sediaan getSatuanSediaan() {
		return satuanSediaan;
	}

	public void setSatuanSediaan(Sediaan satuanSediaan) {
		this.satuanSediaan = satuanSediaan;
	}

	public Integer getSatuanSediaanId() {
		return satuanSediaanId;
	}

	public void setSatuanSediaanId(Integer satuanSediaanId) {
		this.satuanSediaanId = satuanSediaanId;
	}

	public Integer getSatuanVolumeId() {
		return satuanVolumeId;
	}

	public void setSatuanVolumeId(Integer satuanVolumeId) {
		this.satuanVolumeId = satuanVolumeId;
	}

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

	public Integer getId() {

		return id;
	}

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