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 = "Implementasi_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class Implementasi extends BaseKeyValueMaster {

	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "public.Implementasi_m_id_seq")
	@SequenceGenerator(name = "public.Implementasi_m_id_seq", sequenceName = "public.Implementasi_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 Implementasi")
	@JoinColumn(name = "ObjectHeadImplementasiFk")
	private Implementasi headImplementasi;

	@Column(name = "ObjectHeadImplementasiFk", insertable = false, updatable = false)
	private Integer headImplementasiId;

}
