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;

@Getter
@Setter
@Entity
@Table(name = "MappingKelompokToJabatan_M")
public class MappingKelompokToJabatan extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "JabatanFk")
	@NotNull(message = "Jabatan Harus Diisi")
	@Caption(value = "Jabatan")
	private Jabatan jabatan;

	@Column(name = "JabatanFk", insertable = false, updatable = false)
	private Integer jabatanId;

	@ManyToOne
	@JoinColumn(name = "KelompokJabatanFk")
	@NotNull(message = "KelompokJabatan Harus Diisi")
	@Caption(value = "KelompokJabatan")
	private KelompokJabatan kelompokJabatan;

	@Column(name = "KelompokJabatanFk", insertable = false, updatable = false)
	private Integer kelompokJabatanId;

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

}
