package com.jasamedika.medifirst2000.entities;

import java.util.Date;
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 com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;

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

	@ManyToOne
	@JoinColumn(name = "ObjectUnitKerjaFk")
	@Caption(value = "Object Unit Kerja")
	private UnitKerja unitKerja;

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

	@Column(name = "Status", nullable = true)
	@Caption(value = "Status")
	private String status;

	@Column(name = "TglUsulan", nullable = true)
	@Caption(value = "Tanggal Usulan")
	private Date tglUsulan;

	@Column(name = "PeriodeAnggaran", nullable = true)
	@Caption(value = "Periode Anggaran")
	private Date periodeAnggaran;

	@JsonManagedReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "penyusunanEPlanning")
	@Caption(value = "penyusunanDetailEPlanningSet")
	private Set<PenyusunanDetailEPlanning> penyusunanDetailEPlanningSet = new HashSet<PenyusunanDetailEPlanning>();

	public UnitKerja getUnitKerja() {
		return unitKerja;
	}

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

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Date getTglUsulan() {
		return tglUsulan;
	}

	public void setTglUsulan(Date tglUsulan) {
		this.tglUsulan = tglUsulan;
	}

	public Set<PenyusunanDetailEPlanning> getPenyusunanDetailEPlanningSet() {
		return penyusunanDetailEPlanningSet;
	}

	public void setPenyusunanDetailEPlanningSet(Set<PenyusunanDetailEPlanning> penyusunanDetailEPlanningSet) {
		this.penyusunanDetailEPlanningSet = penyusunanDetailEPlanningSet;
	}

	public Date getPeriodeAnggaran() {
		return periodeAnggaran;
	}

	public void setPeriodeAnggaran(Date periodeAnggaran) {
		this.periodeAnggaran = periodeAnggaran;
	}

}
