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 javax.validation.constraints.NotNull;

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

@Entity
@Table(name = "Disposisi_T")
public class Disposisi extends BaseTransaction{
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectDokumenFk")
	@NotNull(message="Object Dokumen Harus Diisi")
	@Caption(value="Object Dokumen")
	private Dokumen dokumen;
	
	@Column(name = "ObjectDokumenFk", insertable=false,updatable=false)
	private Integer ObjectDokumenId;
	
	@Column(name = "NoSurat", nullable = true )
	@Caption(value="noSurat")
	private String noSurat;
	
	@Column(name = "hal", nullable = true )
	@Caption(value="hal")
	private String hal;
	
	@ManyToOne
	@JoinColumn(name = "ObjectJabatanDisampaikanFk")
	@Caption(value="Disampaikan")
	private Jabatan jabatanDisampaikan;
	
	@Column(name = "ObjectJabatanDisampaikanFk", insertable=false,updatable=false, nullable = true)
	private Integer jabatanDisampaikanId;
	
	@ManyToOne
	@JoinColumn(name = "ObjectPegawaiDisampaikanFk")
	@Caption(value="Disampaikan")
	private Pegawai pegawaiDisampaikan;
	
	@Column(name = "ObjectJabatanDisampaikanFk", insertable=false,updatable=false, nullable = true)
	private Integer pegawaiDisampaikanId;
	
	@ManyToOne
	@JoinColumn(name = "ObjectJabatanAsalSuratFk")
	@Caption(value="Asal Surat")
	private Jabatan jabatanAsalSurat;
	
	@Column(name = "ObjectJabatanDisampaikanFk", insertable=false,updatable=false, nullable = true)
	private Integer jabatanAsalSuratId;
	
	@ManyToOne
	@JoinColumn(name = "ObjectPegawaiAsalSuratFk")
	@Caption(value="Pegawai Disampaikan")
	private Pegawai pegawaiAsalSurat;
	
	@Column(name = "ObjectPegawaiAsalSuratFk", insertable=false,updatable=false, nullable = true)
	private Integer pegawaiAsalSuratId;
	
	@ManyToOne
	@JoinColumn(name = "ObjectSifatSuratFk")
	@Caption(value="Pegawai Disampaikan")
	private SifatSurat sifatSurat;
	
	@Column(name = "ObjectSifatSuratFk", insertable=false,updatable=false, nullable = true)
	private Integer sifatSuratId;
	
	@Column(name = "IsiSurat", nullable = true)
	@Caption(value="isiSurat")
	private String isiSurat;
	
	@JsonManagedReference
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "disposisi")
	private Set<DisposisiJabatan> disposisiJabatan=new HashSet<DisposisiJabatan>();
	
	@JsonManagedReference
	@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "disposisi")
	private Set<DisposisiTanggapan> disposisiTanggapan=new HashSet<DisposisiTanggapan>();
	
	@Column(name = "tanggal", nullable = true )
	@Caption(value="Tanggal")
	private Date tanggal;

	public Dokumen getDokumen() {
		return dokumen;
	}

	public void setDokumen(Dokumen dokumen) {
		this.dokumen = dokumen;
	}

	public Integer getObjectDokumenId() {
		return ObjectDokumenId;
	}

	public void setObjectDokumenId(Integer objectDokumenId) {
		ObjectDokumenId = objectDokumenId;
	}

	public String getNoSurat() {
		return noSurat;
	}

	public void setNoSurat(String noSurat) {
		this.noSurat = noSurat;
	}

	public String getHal() {
		return hal;
	}

	public void setHal(String hal) {
		this.hal = hal;
	}

	
	public Date getTanggal() {
		return tanggal;
	}

	public void setTanggal(Date tanggal) {
		this.tanggal = tanggal;
	}

	public Jabatan getJabatanDisampaikan() {
		return jabatanDisampaikan;
	}

	public void setJabatanDisampaikan(Jabatan jabatanDisampaikan) {
		this.jabatanDisampaikan = jabatanDisampaikan;
	}

	public Integer getJabatanDisampaikanId() {
		return jabatanDisampaikanId;
	}

	public void setJabatanDisampaikanId(Integer jabatanDisampaikanId) {
		this.jabatanDisampaikanId = jabatanDisampaikanId;
	}

	public Pegawai getPegawaiDisampaikan() {
		return pegawaiDisampaikan;
	}

	public void setPegawaiDisampaikan(Pegawai pegawaiDisampaikan) {
		this.pegawaiDisampaikan = pegawaiDisampaikan;
	}

	public Integer getPegawaiDisampaikanId() {
		return pegawaiDisampaikanId;
	}

	public void setPegawaiDisampaikanId(Integer pegawaiDisampaikanId) {
		this.pegawaiDisampaikanId = pegawaiDisampaikanId;
	}

	public Jabatan getJabatanAsalSurat() {
		return jabatanAsalSurat;
	}

	public void setJabatanAsalSurat(Jabatan jabatanAsalSurat) {
		this.jabatanAsalSurat = jabatanAsalSurat;
	}

	public Integer getJabatanAsalSuratId() {
		return jabatanAsalSuratId;
	}

	public void setJabatanAsalSuratId(Integer jabatanAsalSuratId) {
		this.jabatanAsalSuratId = jabatanAsalSuratId;
	}

	public Pegawai getPegawaiAsalSurat() {
		return pegawaiAsalSurat;
	}

	public void setPegawaiAsalSurat(Pegawai pegawaiAsalSurat) {
		this.pegawaiAsalSurat = pegawaiAsalSurat;
	}

	public Integer getPegawaiAsalSuratId() {
		return pegawaiAsalSuratId;
	}

	public void setPegawaiAsalSuratId(Integer pegawaiAsalSuratId) {
		this.pegawaiAsalSuratId = pegawaiAsalSuratId;
	}

	public SifatSurat getSifatSurat() {
		return sifatSurat;
	}

	public void setSifatSurat(SifatSurat sifatSurat) {
		this.sifatSurat = sifatSurat;
	}

	public Integer getSifatSuratId() {
		return sifatSuratId;
	}

	public void setSifatSuratId(Integer sifatSuratId) {
		this.sifatSuratId = sifatSuratId;
	}

	public String getIsiSurat() {
		return isiSurat;
	}

	public void setIsiSurat(String isiSurat) {
		this.isiSurat = isiSurat;
	}

	public Set<DisposisiJabatan> getDisposisiJabatan() {
		return disposisiJabatan;
	}

	public void setDisposisiJabatan(Set<DisposisiJabatan> disposisiJabatan) {
		this.disposisiJabatan = disposisiJabatan;
	}

	public Set<DisposisiTanggapan> getDisposisiTanggapan() {
		return disposisiTanggapan;
	}

	public void setDisposisiTanggapan(Set<DisposisiTanggapan> disposisiTanggapan) {
		this.disposisiTanggapan = disposisiTanggapan;
	}
	
	
	
}
