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 com.fasterxml.jackson.annotation.JsonBackReference;
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 = "CssdBmhp_M")
public class CssdBmhp extends BaseMaster {

	//private static final long serialVersionUID = 5692158402199485792L;

	@JsonBackReference
	@ManyToOne
	@Caption(value = "Cssd Alat")
	@JoinColumn(name = "ObjectCssdSetAlatFk")
	private CssdSetAlat cssdSetAlat;

	@Column(name = "ObjectCssdSetAlatFk", insertable = false, updatable = false)
	private Integer cssdSetAlatId;

	@ManyToOne
	@Caption(value = "Nama Barang")
	@JoinColumn(name = "ObjectNamaBarangFk")
	private Produk namaBarang;

	@Column(name = "ObjectNamaBarangFk", insertable = false, updatable = false)
	private Integer namaBarangId;

	@Column(name = "Jumlah", nullable = true)
	@Caption(value = "Jumlah")
	private Integer jumlah;

	@ManyToOne
	@Caption(value = "Satuan")
	@JoinColumn(name = "ObjectSatuanFk")
	private SatuanStandar satuan;

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

	public SatuanStandar getSatuan() {
		return satuan;
	}

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

	public Integer getJumlah() {
		return jumlah;
	}

	public void setJumlah(Integer jumlah) {
		this.jumlah = jumlah;
	}

	public CssdSetAlat getCssdSetAlat() {
		return cssdSetAlat;
	}

	public void setCssdSetAlat(CssdSetAlat cssdSetAlat) {
		this.cssdSetAlat = cssdSetAlat;
	}

	public Produk getNamaBarang() {
		return namaBarang;
	}

	public void setNamaBarang(Produk namaBarang) {
		this.namaBarang = namaBarang;
	}

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

	public Integer getId() {

		return id;
	}

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