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.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseTransaction;

@SuppressWarnings("serial")
@Entity
@Table(name = "KonversiSatuan_T")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class KonversiSatuan extends BaseTransaction {
	
	@ManyToOne
	@JoinColumn(name = "ObjekProdukFk", nullable = false)
	@NotNull
	@JsonBackReference
	private Produk produk;
	
	@Column(name = "ObjekProdukFk", insertable = false, updatable = false, nullable = false)
	private Integer produkId;
	
	@ManyToOne
	@JoinColumn(name = "SatuanStandar_Asal", nullable = false)
	@NotNull
	@JsonBackReference
	private SatuanStandar satuanStandarAsal;
	
	@Column(name = "satuanStandar_Asal", insertable = false, updatable = false, nullable = false)
	private Integer satuanStandarAsalId;
	
	@ManyToOne
	@JoinColumn(name = "SatuanStandar_Tujuan", nullable = false)
	@NotNull
	@JsonBackReference
	private SatuanStandar satuanStandarTujuan;
	
	@Column(name = "SatuanStandar_Tujuan", insertable = false, updatable = false, nullable = false)
	private Integer satuanStandarTujuanId;
	
	@Column(name = "NilaiKonversi", nullable = false)
	@NotNull
	private Double nilaiKonversi;
	
	public Produk getProduk() {
		return produk;
	}
	
	public void setProduk(Produk produk) {
		this.produk = produk;
	}
	
	public SatuanStandar getSatuanStandarAsal() {
		return satuanStandarAsal;
	}
	
	public void setSatuanStandarAsal(SatuanStandar satuanStandarAsal) {
		this.satuanStandarAsal = satuanStandarAsal;
	}
	
	public SatuanStandar getSatuanStandarTujuan() {
		return satuanStandarTujuan;
	}
	
	public void setSatuanStandarTujuan(SatuanStandar satuanStandarTujuan) {
		this.satuanStandarTujuan = satuanStandarTujuan;
	}
	
	public Double getNilaiKonversi() {
		return nilaiKonversi;
	}
	
	public void setNilaiKonversi(Double nilaiKonversi) {
		this.nilaiKonversi = nilaiKonversi;
	}

	public Integer getProdukId() {
		return produkId;
	}

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

	public Integer getSatuanStandarAsalId() {
		return satuanStandarAsalId;
	}

	public void setSatuanStandarAsalId(Integer satuanStandarAsalId) {
		this.satuanStandarAsalId = satuanStandarAsalId;
	}

	public Integer getSatuanStandarTujuanId() {
		return satuanStandarTujuanId;
	}

	public void setSatuanStandarTujuanId(Integer satuanStandarTujuanId) {
		this.satuanStandarTujuanId = satuanStandarTujuanId;
	}

}
