package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import javax.persistence.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.jasamedika.medifirst2000.base.BaseMaster;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.util.logging.Messages;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class AsalPeserta
 * 
 * @author Generator
 */
@Entity // @Audited
@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;

	public void setAsalPeserta(String asalPeserta) {
		this.asalPeserta = asalPeserta;
	}

	public String getAsalPeserta() {
		return this.asalPeserta;
	}

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

	@NotNull(message = "Kd Asal Peserta tidak boleh kosong")
	@Column(name = "KdAsalPeserta", nullable = false)
	public Byte getKdAsalPeserta() {
		return kdAsalPeserta;
	}

	public void setKdAsalPeserta(Byte kdAsalPeserta) {
		this.kdAsalPeserta = kdAsalPeserta;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")

	@Caption(value = "Object Departemen")
	private Departemen departemen;

	public void setDepartemen(Departemen departemen) {
		this.departemen = departemen;
	}

	public Departemen getDepartemen() {
		return this.departemen;
	}

	public Integer getDepartemenId() {
		return departemenId;
	}

	public void setDepartemenId(Integer departemenId) {
		this.departemenId = departemenId;
	}

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

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

	@NotNull(message = "QAsal Peserta tidak boleh kosong")
	@Column(name = "QAsalPeserta", nullable = false)
	public Byte getqAsalPeserta() {
		return qAsalPeserta;
	}

	public void setqAsalPeserta(Byte qAsalPeserta) {
		this.qAsalPeserta = qAsalPeserta;
	}

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

	public Integer getId() {

		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
}