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

	@ManyToOne
	@JoinColumn(name = "ObjectDiagnosaFk")
	@NotNull(message = "Kd Diagnosa tidak boleh kosong")
	@Caption(value = "Object Diagnosa")
	private Diagnosa diagnosa;

	@Column(name = "ObjectDiagnosaFk", insertable = false, updatable = false)
	private Integer diagnosaId;

	@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, nullable = false)
	private Integer kasusPenyakitId;

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

}