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.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE;

/**
 * class MapKelompokPasienToPenjamin
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "MapKelompokPasienToPenjamin_M")
public class MapKelompokPasienToPenjamin extends BaseMaster {

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectKelompokPasienFk")
	@NotNull(message = "Kd Kelompok Pasien tidak boleh kosong")
	@Caption(value = "Object Kelompok Pasien")
	private KelompokPasien kelompokPasien;

	@Column(name = "ObjectKelompokPasienFk", insertable = false, updatable = false)
	private Integer kelompokPasienId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "kdPenjaminPasien")
	@Caption(value = "Object Rekanan")
	private Rekanan rekanan;

	@Column(name = "kdPenjaminPasien", insertable = false, updatable = false)
	private Integer jenisRekananId;

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

}
