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 DetailAsalRujukan
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "DetailAsalRujukan_M")
public class DetailAsalRujukan extends BaseMaster {
	@NotNull(message = "Detail Asal Rujukan tidak boleh kosong")
	@Column(name = "DetailAsalRujukan", nullable = false, length = 50)
	@Caption(value = "Detail Asal Rujukan")
	private String detailAsalRujukan;

	public void setDetailAsalRujukan(String detailAsalRujukan) {
		this.detailAsalRujukan = detailAsalRujukan;
	}

	public String getDetailAsalRujukan() {
		return this.detailAsalRujukan;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectAsalRujukanFk")
	@NotNull(message = "Kd Asal Rujukan tidak boleh kosong")

	@Caption(value = "Object Asal Rujukan")
	private AsalRujukan asalRujukan;

	public void setAsalRujukan(AsalRujukan asalRujukan) {
		this.asalRujukan = asalRujukan;
	}

	public AsalRujukan getAsalRujukan() {
		return this.asalRujukan;
	}

	@Column(name = "ObjectAsalRujukanFk", insertable = false, updatable = false)
	private Integer asalRujukanId;

	@NotNull(message = "Kd Detail Asal Rujukan tidak boleh kosong")
	@Column(name = "KdDetailAsalRujukan", nullable = false, length = 4)
	@Caption(value = "Kode Detail Asal Rujukan")
	private String kdDetailAsalRujukan;

	public void setKdDetailAsalRujukan(String kdDetailAsalRujukan) {
		this.kdDetailAsalRujukan = kdDetailAsalRujukan;
	}

	public String getKdDetailAsalRujukan() {
		return this.kdDetailAsalRujukan;
	}

	@NotNull(message = "QDetail Asal Rujukan tidak boleh kosong")
	@Column(name = "QDetailAsalRujukan", nullable = false)
	@Caption(value = "QDetail Asal Rujukan")
	private short qDetailAsalRujukan;

	public void setqDetailAsalRujukan(short qDetailAsalRujukan) {
		this.qDetailAsalRujukan = qDetailAsalRujukan;
	}

	public short getqDetailAsalRujukan() {
		return this.qDetailAsalRujukan;
	}

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

	public Integer getId() {

		return id;
	}

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