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 DetailAsalRujukan
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@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;

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

	@Caption(value = "Object Asal Rujukan")
	private AsalRujukan 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;

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

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

}