package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
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 MapPasienToJabatan
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "MapPelatihanPaketToJabatan_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class MapPelatihanPaketToJabatan extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "ObjectPeatihanFk")
	@NotNull(message = "Paket Tidak Boleh Kosong")
	private PelatihanPaket pelatihanPaket;

	@Column(name = "ObjectPeatihanFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String pelatihanPaketId;

	@ManyToOne
	@JoinColumn(name = "ObjectJabatanFk")
	@NotNull(message = "Kd Jabatan tidak boleh kosong")
	@Caption(value = "Object Jabatan")
	private Jabatan jabatan;

	@Column(name = "ObjectJabatanFk", insertable = false, updatable = false, nullable = false)
	private Integer jabatanId;

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

}