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

	@ManyToOne
	@JoinColumn(name = "ObjectGolonganAsuransiFk")
	@NotNull(message = "Kd Golongan Asuransi tidak boleh kosong")
	@Caption(value = "Object Golongan Asuransi")
	private GolonganAsuransi kdGolonganAsuransi;

	@Column(name = "ObjectGolonganAsuransiFk", insertable = false, updatable = false)
	private Integer golonganAsuransiId;

	@ManyToOne
	@JoinColumn(name = "ObjectHubunganPesertaFk")
	@NotNull(message = "Kd Hubungan Peserta tidak boleh kosong")
	@Caption(value = "Object Hubungan Peserta")
	private HubunganPesertaAsuransi hubunganPeserta;

	@Column(name = "ObjectHubunganPesertaFk", insertable = false, updatable = false, nullable = false)
	private Integer hubunganPesertaId;

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

	@ManyToOne
	@JoinColumn(name = "ObjectPaketFk")
	@NotNull(message = "Kd Paket tidak boleh kosong")
	@Caption(value = "Object Paket")
	private Paket paket;

	@Column(name = "ObjectPaketFk", insertable = false, updatable = false, nullable = false)
	private Integer paketId;

	@NotNull(message = "Kd Penjamin Pasien tidak boleh kosong")
	@Column(name = "KdPenjaminPasien", nullable = false)
	@Caption(value = "Kode Penjamin Pasien")
	private short kdPenjaminPasien;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")
	@NotNull(message = "Kd Produk tidak boleh kosong")
	@Caption(value = "Object Produk")
	private Produk produk;

	@Column(name = "ObjectProdukFk", insertable = false, updatable = false, nullable = false)
	private Integer produkId;

	@Column(name = "QtyMaxProduk")
	@Caption(value = "Qty Max Produk")
	private short qtyMaxProduk;

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

}