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.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name="SubUnitkerja_M")
public class SubUnitKerjaPegawai extends BaseKeyValueMaster{
	
	private static final long serialVersionUID = 6276984733159545428L;

	public SubUnitKerjaPegawai()
	{}
	
	public SubUnitKerjaPegawai(Integer id, String name)
	{
		super();
		this.id = id;
		this.setName(name);
	}
	
	public SubUnitKerjaPegawai(Integer id) {
		super();
		this.id = id;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.subunitkerjapegawai_m_id_seq")
	@javax.persistence.SequenceGenerator(name = "public.subunitkerjapegawai_m_id_seq", sequenceName = "public.subunitkerjapegawai_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "objectUnitKerjaPegawaifk")
	@Caption(value = "Object UnitKerjaPegawai ")
	private UnitKerjaPegawai unitKerja;
	
	@Column(name = "objectUnitKerjaPegawaifk", insertable = false, updatable = false)
	private Integer unitKerjaId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "objectJabatanKepalafk")
	@Caption(value = "Object Jabatan Kepala ")
	private Jabatan jabatanKepala;
	
	@Column(name = "objectJabatanKepalafk", insertable = false, updatable = false)
	private Integer jabatanKepalaId;

	public Integer getId() {
		return id;
	}

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

	public UnitKerjaPegawai getUnitKerja() {
		return unitKerja;
	}

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

	public Integer getUnitKerjaId() {
		return unitKerjaId;
	}

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

	public Jabatan getJabatanKepala() {
		return jabatanKepala;
	}

	public void setJabatanKepala(Jabatan jabatanKepala) {
		this.jabatanKepala = jabatanKepala;
	}

	public Integer getJabatanKepalaId() {
		return jabatanKepalaId;
	}

	public void setJabatanKepalaId(Integer jabatanKepalaId) {
		this.jabatanKepalaId = jabatanKepalaId;
	}
		
}
