package com.jasamedika.medifirst2000.entities;

import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

import static javax.persistence.GenerationType.SEQUENCE;

/**
 * class JenisPegawai
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "JenisPegawai_M")
public class JenisPegawai extends BaseMaster {

	@NotNull(message = "Jenis Pegawai tidak boleh kosong")
	@Column(name = "JenisPegawai", nullable = false, length = 30)
	@Caption(value = "Jenis Pegawai")
	private String jenisPegawai;

	@ManyToOne
	@JoinColumn(name = "ObjectDetailKelompokPegawaiFk")
	@Caption(value = "Object Detail Kelompok Pegawai")
	private DetailKelompokPegawai detailKelompokPegawai;

	@Column(name = "ObjectDetailKelompokPegawaiFk", insertable = false, updatable = false)
	private Integer detailKelompokPegawaiId;

	@NotNull(message = "Kd Jenis Pegawai tidak boleh kosong")
	@Column(name = "KdJenisPegawai", nullable = false, length = 2)
	@Caption(value = "Kode Jenis Pegawai")
	private String kdJenisPegawai;

	@NotNull(message = "QJenis Pegawai tidak boleh kosong")
	@Column(name = "QJenisPegawai", nullable = false)
	@Caption(value = "QJenis Pegawai")
	private Byte qJenisPegawai;

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

}