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 JenisSatuanKerja
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "JenisSatuanKerja_M")
public class JenisSatuanKerja extends BaseMaster {

	@NotNull(message = "Jenis Satuan Kerja tidak boleh kosong")
	@Column(name = "JenisSatuanKerja", nullable = false, length = 100)
	@Caption(value = "Jenis Satuan Kerja")
	private String jenisSatuanKerja;

	@NotNull(message = "Kd Jenis Satuan Kerja tidak boleh kosong")
	@Column(name = "KdJenisSatuanKerja", nullable = false)
	@Caption(value = "Kode Jenis Satuan Kerja")
	private Byte kdJenisSatuanKerja;

	@Column(name = "KdPimpinan", length = 5)
	@Caption(value = "Kode Pimpinan")
	private String kdPimpinan;

	@ManyToOne
	@JoinColumn(name = "ObjectUnitKerjaFk")
	@NotNull(message = "Kd Unit Kerja tidak boleh kosong")
	@Caption(value = "Object Unit Kerja")
	private UnitKerja unitKerja;

	@Column(name = "ObjectUnitKerjaFk", insertable = false, updatable = false)
	private Integer unitKerjaId;

	@Column(name = "NoJenisSatuanKerja", length = 50)
	@Caption(value = "No Jenis Satuan Kerja")
	private String noJenisSatuanKerja;

	@NotNull(message = "QJenis Satuan Kerja tidak boleh kosong")
	@Column(name = "QJenisSatuanKerja", nullable = false)
	@Caption(value = "QJenis Satuan Kerja")
	private Byte qJenisSatuanKerja;

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

}