package com.jasamedika.medifirst2000.entities;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;




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

@Entity
@Table(name="HeadAnggaran_T")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class HeadAnggaran extends BaseTransaction{

	@Caption(value="Kode Head Anggaran")
	@Column(name="KdHeadAnggaran", length = 50)
	private String kdHeadAnggaran;
	
	@Caption(value="Tahun")
	@Column(name="Tahun")
	private Integer tahun;
	
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "headAnggaran")
	@Caption(value = "Kegiatan Anggaran")
	private Set<KegiatanAnggaran> kegiatanAnggaran = new HashSet<KegiatanAnggaran>();

	@ManyToOne
	@JoinColumn(name = "ObjectKemenLembFk")
	@Caption(value="Kemen/Lemb")
	private KemenLemb kemenLemb;
	
	@Column(name="ObjectKemenLembFk", insertable = false, updatable = false, nullable = false)
	private Integer kemenLembId;
	
	@ManyToOne
	@JoinColumn(name = "ObjectUnitOrganisasiFk")
	@Caption(value="Unit Organisasi")
	private UnitOrg unitOrganisasi;
	
	@Column(name="ObjectUnitOrganisasiFk", insertable = false, updatable = false, nullable = false)
	private Integer unitOrganisasiId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectRuanganFk")
	@Caption(value = "Object Ruangan")
	private Ruangan ruangan;

	@Column(name = "ObjectRuanganFk", insertable = false, updatable = false, nullable = false)
	private Integer ruanganId;
	
	@ManyToOne
	@JoinColumn(name = "ObjectProgramFk")
	@Caption(value="Program")
	private Program program;
	
	@Column(name="ObjectProgramFk", insertable = false, updatable = false, nullable = false)
	private Integer programId;
	
	@ManyToOne
	@JoinColumn(name = "ObjectUnitKerjaFk")
	@Caption(value = "Object Unit Kerja")
	private UnitKerja unitKerja;
	
	@Column(name = "ObjectUnitKerjaFk", insertable = false, updatable = false, nullable = true)
	private Integer unitKerjaId;

	public String getKdHeadAnggaran() {
		return kdHeadAnggaran;
	}

	public void setKdHeadAnggaran(String kdHeadAnggaran) {
		this.kdHeadAnggaran = kdHeadAnggaran;
	}

	public Set<KegiatanAnggaran> getKegiatanAnggaran() {
		return kegiatanAnggaran;
	}

	public void setKegiatanAnggaran(Set<KegiatanAnggaran> kegiatanAnggaran) {
		this.kegiatanAnggaran = kegiatanAnggaran;
	}



	public KemenLemb getKemenLemb() {
		return kemenLemb;
	}

	public void setKemenLemb(KemenLemb kemenLemb) {
		this.kemenLemb = kemenLemb;
	}

	public Integer getKemenLembId() {
		return kemenLembId;
	}

	public void setKemenLembId(Integer kemenLembId) {
		this.kemenLembId = kemenLembId;
	}

	public UnitOrg getUnitOrganisasi() {
		return unitOrganisasi;
	}

	public void setUnitOrganisasi(UnitOrg unitOrganisasi) {
		this.unitOrganisasi = unitOrganisasi;
	}

	public Integer getUnitOrganisasiId() {
		return unitOrganisasiId;
	}

	public void setUnitOrganisasiId(Integer unitOrganisasiId) {
		this.unitOrganisasiId = unitOrganisasiId;
	}

	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 Program getProgram() {
		return program;
	}

	public void setProgram(Program program) {
		this.program = program;
	}

	public Integer getProgramId() {
		return programId;
	}

	public void setProgramId(Integer programId) {
		this.programId = programId;
	}

	public Integer getTahun() {
		return tahun;
	}

	public void setTahun(Integer tahun) {
		this.tahun = tahun;
	}

	public UnitKerja getUnitKerja() {
		return unitKerja;
	}

	public void setUnitKerja(UnitKerja unitKerja) {
		this.unitKerja = unitKerja;
	}

	public Integer getUnitKerjaId() {
		return unitKerjaId;
	}

	public void setUnitKerjaId(Integer unitKerjaId) {
		this.unitKerjaId = unitKerjaId;
	}

}
