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

	@NotNull(message = "Kode Diagnosa Tindakan tidak boleh kosong")
	@Column(name = "KdDiagnosaTindakan", nullable = false, length = 5)
	@Caption(value = "Kode Diagnosa Tindakan")
	private String kdDiagnosaTindakan;

	@Caption(value = "Diagnosa Tindakan")
	private String namaDiagnosaTindakan;

	@ManyToOne
	@JoinColumn(name = "ObjectDiagnosaTindakanFk")
	@NotNull(message = "Kd Diagnosa Tindakan tidak boleh kosong")

	@Caption(value = "Object Diagnosa Tindakan")
	private Diagnosa diagnosaTindakan;

	@Column(name = "ObjectDiagnosaTindakanFk", insertable = false, updatable = false)
	private Integer diagnosaTindakanId;

	@ManyToOne
	@JoinColumn(name = "ObjectKategoryDiagnosaFk")
	@NotNull(message = "Kd Kategory Diagnosa tidak boleh kosong")

	@Caption(value = "Object Kategory Diagnosa")
	private KategoryDiagnosa kategoryDiagnosa;

	@Column(name = "ObjectKategoryDiagnosaFk", insertable = false, updatable = false, nullable = false)
	private Integer kategoryDiagnosaId;

	@NotNull(message = "QDiagnosa Tindakan tidak boleh kosong")
	@Column(name = "QDiagnosaTindakan", nullable = false)
	@Caption(value = "QDiagnosa Tindakan")
	private Integer qDiagnosaTindakan;

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

}