package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.jasamedika.medifirst2000.base.BaseMaster;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.util.logging.Messages;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;

/**
 * class JenisDokumen
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "JenisDokumen_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class JenisDokumen extends BaseMaster {

	@NotNull(message = "Jenis Dokumen tidak boleh kosong")
	@Column(name = "JenisDokumen", nullable = false, length = 50)
	@Caption(value = "Jenis Dokumen")
	private String jenisDokumen;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectDepartemenFk")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

	@Column(name = "ObjectDepartemenFk", insertable = false, updatable = false)
	private Integer departemenId;

	@NotNull(message = "Kd Jenis Dokumen tidak boleh kosong")
	@Column(name = "KdJenisDokumen", nullable = false)
	@Caption(value = "Kode Jenis Dokumen")
	private short kdJenisDokumen;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectJenisDokumenHeadFk")
	@Caption(value = "Object Jenis Dokumen Head")
	private JenisDokumen jenisDokumenHead;

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

	@NotNull(message = "QJenis Dokumen tidak boleh kosong")
	@Column(name = "QJenisDokumen", nullable = false)
	@Caption(value = "QJenis Dokumen")
	private short qJenisDokumen;

	public String getJenisDokumen() {
		return jenisDokumen;
	}

	public void setJenisDokumen(String jenisDokumen) {
		this.jenisDokumen = jenisDokumen;
	}

	public Departemen getDepartemen() {
		return departemen;
	}

	public void setDepartemen(Departemen departemen) {
		this.departemen = departemen;
	}

	public Integer getDepartemenId() {
		return departemenId;
	}

	public void setDepartemenId(Integer departemenId) {
		this.departemenId = departemenId;
	}

	public short getKdJenisDokumen() {
		return kdJenisDokumen;
	}

	public void setKdJenisDokumen(short kdJenisDokumen) {
		this.kdJenisDokumen = kdJenisDokumen;
	}

	public JenisDokumen getJenisDokumenHead() {
		return jenisDokumenHead;
	}

	public void setJenisDokumenHead(JenisDokumen jenisDokumenHead) {
		this.jenisDokumenHead = jenisDokumenHead;
	}

	public Integer getJenisDokumenHeadId() {
		return jenisDokumenHeadId;
	}

	public void setJenisDokumenHeadId(Integer jenisDokumenHeadId) {
		this.jenisDokumenHeadId = jenisDokumenHeadId;
	}

	public short getqJenisDokumen() {
		return qJenisDokumen;
	}

	public void setqJenisDokumen(short qJenisDokumen) {
		this.qJenisDokumen = qJenisDokumen;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.jenisdokumen_m_id_seq")
	@javax.persistence.SequenceGenerator(name = "public.jenisdokumen_m_id_seq", sequenceName = "public.jenisdokumen_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

	public Integer getId() {

		return id;
	}

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