package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import javax.persistence.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.jasamedika.medifirst2000.base.BaseMaster;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.util.logging.Messages;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class MapKasusPenyakitToPegawai
 * 
 * @author Generator
 */
@Entity // @Audited
@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;

	public void setKasusPenyakit(KasusPenyakit kasusPenyakit) {
		this.kasusPenyakit = kasusPenyakit;
	}

	public KasusPenyakit getKasusPenyakit() {
		return this.kasusPenyakit;
	}

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

	public Integer getKasusPenyakitId() {
		return kasusPenyakitId;
	}

	public void setKasusPenyakitId(Integer kasusPenyakitId) {
		this.kasusPenyakitId = kasusPenyakitId;
	}

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

	public Pegawai getPegawai() {
		return pegawai;
	}

	public void setPegawai(Pegawai pegawai) {
		this.pegawai = pegawai;
	}

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

	public Integer getPegawaiId() {
		return pegawaiId;
	}

	public void setPegawaiId(Integer pegawaiId) {
		this.pegawaiId = pegawaiId;
	}

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

	public Integer getId() {

		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
}