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 = "UnitKerjaPegawai_M")
public class UnitKerjaPegawai extends BaseKeyValueMaster{
	
	public UnitKerjaPegawai()
	{}
	
	public UnitKerjaPegawai(Integer id) {
		super();
		this.id = id;
	}

	public UnitKerjaPegawai(Integer id, String name)
	{
		super();
		this.id = id;
		this.setName(name);
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.unitkerjapegawai_m_id_seq")
	@javax.persistence.SequenceGenerator(name = "public.unitkerjapegawai_m_id_seq", sequenceName = "public.unitkerjapegawai_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;
	
	@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 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;
	}

}
