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

	@ManyToOne
	@JoinColumn(name = "ObjectKasusPenyakitFk")
	@NotNull(message = "Kd Kasus Penyakit tidak boleh kosong")
	@Caption(value = "Object Kasus Penyakit")
	private KasusPenyakit kasusPenyakit;

	@Column(name = "ObjectKasusPenyakitFk", insertable = false, updatable = false)
	private Integer kasusPenyakitId;

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

	@Column(name = "ObjectPegawaiFk", insertable = false, updatable = false, nullable = false)
	private Integer pegawaiId;

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

}