package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;

import static javax.persistence.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "Intervensi_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class Intervensi extends BaseKeyValueMaster {

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

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Object Diagnosi Keperawatan")
	@JoinColumn(name = "ObjectDiagnosaKeperawatanFk")
	private DiagnosaKeperawatan diagnosaKeperawatan;

	@Column(name = "ObjectDiagnosaKeperawatanFk", insertable = false, updatable = false)
	private Integer diagnosaKeperawatanId;

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Object Head Intervensi")
	@JoinColumn(name = "ObjectHeadIntervensiFk")
	private Intervensi headIntervensi;

	@Column(name = "ObjectHeadIntervensiFk", insertable = false, updatable = false)
	private Integer headIntervensiId;

}
