package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "UnitCost_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class UnitCost extends BaseMaster {

	 
	
	@Column(name = "KodeUnitCost", nullable = true)
	@Caption(value = "KodeUnitCost")
	private String kodeUnitCost;
	
	@Column(name = "NamaUnitCost", nullable = true)
	@Caption(value = "NamaUnitCost")
	private String namaUnitCost;

	/*@JsonManagedReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "unitCost")
	@Caption(value = "unitCostDetailSet")
	private Set<UnitCostDetail> unitCostDetailSet = new HashSet<UnitCostDetail>();*/

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "produkFK")
	@Caption(value = "Produk Tindakan")
	private Produk produk;

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

	@ManyToOne
	@JoinColumn(name = "ruanganFk")
	@Caption(value = "Object Ruangan")
	private Ruangan ruangan;
	
	@Column(name = "ruanganFk", insertable = false, updatable = false, nullable = true)
	private Integer ruanganId;
	
	/*public Set<UnitCostDetail> getUnitCostDetail() {
		return unitCostDetailSet;
	}	
*/
	 


	public String getNamaUnitCost() {
		return namaUnitCost;
	}

	public void setNamaUnitCost(String namaUnitCost) {
		this.namaUnitCost = namaUnitCost;
	}

/*	public Set<UnitCostDetail> getUnitCostDetailSet() {
		return unitCostDetailSet;
	}

	public void setUnitCostDetailSet(Set<UnitCostDetail> unitCostDetailSet) {
		this.unitCostDetailSet = unitCostDetailSet;
	}
*/
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.unitcost_m_id_seq")
	@javax.persistence.SequenceGenerator(name = "public.unitcost_m_id_seq", sequenceName = "public.unitcost_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

	public Integer getId() {
		return id;
	}

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

	public Produk getProduk() {
		return produk;
	}

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

	public Integer getProdukId() {
		return produkId;
	}

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

	public Ruangan getRuangan() {
		return ruangan;
	}

	public void setRuangan(Ruangan ruangan) {
		this.ruangan = ruangan;
	}

	public Integer getRuanganId() {
		return ruanganId;
	}

	public void setRuanganId(Integer ruanganId) {
		this.ruanganId = ruanganId;
	}



	public String getKodeUnitCost() {
		return kodeUnitCost;
	}



	public void setKodeUnitCost(String kodeUnitCost) {
		this.kodeUnitCost = kodeUnitCost;
	}
	
}
