package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

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

@Entity
@Table(name = "NotaDinasJabatan_T")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class NotaDinasJabatan extends BaseTransaction {
	
	@JsonBackReference
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectNotaDinasFk")
	@Caption(value="NotaDinas")
	private NotaDinas notaDinas;
	
	@Column(name = "ObjectNotaDinasFk", insertable=false,updatable=false, nullable = true)
	private String notaDinasId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectJabatanFk")
	@Caption(value="jabatan")
	private Jabatan jabatan;
	
	@Column(name = "ObjectJabatanFk", insertable=false,updatable=false, nullable = true)
	private Integer jabatanId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectPegawaiFk")
	@Caption(value="pegawai")
	private Pegawai pegawai;
	
	@Column(name = "ObjectPegawaiFk", insertable=false,updatable=false, nullable = true)
	private Integer pegawaiId;
	
	@Column(name = "isRead",columnDefinition = "boolean default false")
	@Caption("Is Nota Dinas/ Disposisi was read")
	public Boolean isRead;
	
	public NotaDinas getNotaDinas() {
		return notaDinas;
	}

	public void setNotaDinas(NotaDinas notaDinas) {
		this.notaDinas = notaDinas;
	}

	public String getNotaDinasId() {
		return notaDinasId;
	}

	public void setNotaDinasId(String notaDinasId) {
		this.notaDinasId = notaDinasId;
	}

	public Jabatan getJabatan() {
		return jabatan;
	}

	public void setJabatan(Jabatan jabatan) {
		this.jabatan = jabatan;
	}

	public Integer getJabatanId() {
		return jabatanId;
	}

	public void setJabatanId(Integer jabatanId) {
		this.jabatanId = jabatanId;
	}

	public Pegawai getPegawai() {
		return pegawai;
	}

	public void setPegawai(Pegawai pegawai) {
		this.pegawai = pegawai;
	}

	public Integer getPegawaiId() {
		return pegawaiId;
	}

	public void setPegawaiId(Integer pegawaiId) {
		this.pegawaiId = pegawaiId;
	}

	public Boolean getIsRead() {
		return isRead;
	}

	public void setIsRead(Boolean isRead) {
		this.isRead = isRead;
	}
	
}
