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.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class KelompokPegawai
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "KelompokPegawai_M")
public class KelompokPegawai extends BaseMaster {
	@Caption(value = "Kode Kelompok Pegawai")
	private String kdKelompokPegawai;

	public void setKdKelompokPegawai(String kdKelompokPegawai) {
		this.kdKelompokPegawai = kdKelompokPegawai;
	}

	@NotNull(message = "Kd Kelompok Pegawai tidak boleh kosong")
	@Column(name = "KdKelompokPegawai", nullable = false, length = 1)
	public String getKdKelompokPegawai() {
		return this.kdKelompokPegawai;
	}

	@Caption(value = "Kelompok Pegawai")
	private String kelompokPegawai;

	public void setKelompokPegawai(String kelompokPegawai) {
		this.kelompokPegawai = kelompokPegawai;
	}

	@NotNull(message = "Kelompok Pegawai tidak boleh kosong")
	@Column(name = "KelompokPegawai", nullable = false, length = 30)
	public String getKelompokPegawai() {
		return this.kelompokPegawai;
	}

	@Caption(value = "QKelompok Pegawai")
	private Byte qKelompokPegawai;

	public void setqKelompokPegawai(Byte qKelompokPegawai) {
		this.qKelompokPegawai = qKelompokPegawai;
	}

	@NotNull(message = "QKelompok Pegawai tidak boleh kosong")
	@Column(name = "QKelompokPegawai", nullable = false)
	public Byte getqKelompokPegawai() {
		return this.qKelompokPegawai;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
	 * "kdkelompokpegawai") private Set<DetailKelompokPegawai>
	 * DetailKelompokPegawaiSet = new HashSet<DetailKelompokPegawai>();
	 * 
	 * public Set<DetailKelompokPegawai> getDetailKelompokPegawaiSet() { return
	 * DetailKelompokPegawaiSet; }
	 * 
	 * public void setDetailKelompokPegawaiSet(Set<DetailKelompokPegawai>
	 * detailKelompokPegawaiSet) { DetailKelompokPegawaiSet =
	 * detailKelompokPegawaiSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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