package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseMaster;
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 = "IpsrsTeknisiKontakService_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class IpsrsTeknisiKontakService extends BaseMaster {

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Ipsrs Kontak Service")
	@JoinColumn(name = "ObjectIpsrsKontakServiceFk")
	private IpsrsKontakService ipsrsKontakService;

	@Column(name = "ObjectIpsrsKontakServiceFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false)
	private String ipsrsKontakServiceId;

	@ManyToOne(fetch = LAZY)
	@Caption(value = "Nama Teknisi/Teknisi Pendamping")
	@JoinColumn(name = "ObjectTeknisiFk")
	private Pegawai teknisi;

	@Column(name = "ObjectTeknisiFk", insertable = false, updatable = false)
	private Integer teknisiId;

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

}