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 java.util.Date;

import static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "MappingPegawaiToAtasan_m")
public class MappingPegawaiToAtasan extends BaseMaster {

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

	@ManyToOne
	@JoinColumn(name = "ObjectPegawaiFk")
	@NotNull(message = "Object Pegawai Harus Diisi")
	@Caption(value = "Object Pegawai")
	private Pegawai pegawai;

	@ManyToOne
	@JoinColumn(name = "ObjectAtasanLangsungFk")
	@NotNull(message = "ObjectatasanLangsung Harus Diisi")
	@Caption(value = "ObjectatasanLangsung")
	private Pegawai atasanLangsung;

	@ManyToOne
	@JoinColumn(name = "ObjectAtasanPejabatPenilaiFk")
	@NotNull(message = "Object AtasanPejabatPenilai Harus Diisi")
	@Caption(value = "ObjectAtasanPejabatPenilai")
	private Pegawai atasanPejabatPenilai;

	@Column(name = "tglInput")
	private Date tglInput;

}
