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

	@NotNull(message = "Asal Peserta tidak boleh kosong")
	@Column(name = "AsalPeserta", nullable = false, length = 30)
	@Caption(value = "Asal Peserta")
	private String asalPeserta;

	@Caption(value = "Kode Asal Peserta")
	private Byte kdAsalPeserta;

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

	@Column(name = "ObjectDepartemenFk", insertable = false, updatable = false)
	private Integer departemenId;

	@Caption(value = "QAsal Peserta")
	private Byte qAsalPeserta;

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

}