package com.jasamedika.medifirst2000.entities;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "IpsrsMaintenance_T")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class IpsrsMaintenance extends BaseTransaction{
	
	@JsonBackReference
	@OneToOne(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "ipsrsMaintenance")
	private IpsrsPemeliharaan ipsrsPemeliharaan;
	
	@JsonBackReference
	@OneToOne(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "ipsrsMaintenance")
	private IpsrsKontakService ipsrsKontakService;
	
	@JsonBackReference
	@OneToOne(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "ipsrsMaintenance")
	private IpsrsKalibrasi ipsrsKalibrasi;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectRuanganFk")
	@Caption(value = "Ruangan")
	private Ruangan ruangan;
	
	@Column(name = "ObjectRuanganFk",nullable=true, insertable = false, updatable = false)
	private Integer ruanganId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectRegistrasiAsetFk")
	@Caption(value = "Registrasi Aset")
	private RegistrasiAset registrasiAset;
	
	@Column(name = "ObjectRegistrasiAsetFk", columnDefinition = "CHAR(32)", nullable=true, insertable = false, updatable = false)
	private String registrasiAsetId;

	public IpsrsPemeliharaan getIpsrsPemeliharaan() {
		return ipsrsPemeliharaan;
	}

	public void setIpsrsPemeliharaan(IpsrsPemeliharaan ipsrsPemeliharaan) {
		this.ipsrsPemeliharaan = ipsrsPemeliharaan;
	}

	public IpsrsKontakService getIpsrsKontakService() {
		return ipsrsKontakService;
	}

	public void setIpsrsKontakService(IpsrsKontakService ipsrsKontakService) {
		this.ipsrsKontakService = ipsrsKontakService;
	}

	public IpsrsKalibrasi getIpsrsKalibrasi() {
		return ipsrsKalibrasi;
	}

	public void setIpsrsKalibrasi(IpsrsKalibrasi ipsrsKalibrasi) {
		this.ipsrsKalibrasi = ipsrsKalibrasi;
	}

	public Ruangan getRuangan() {
		return ruangan;
	}

	public void setRuangan(Ruangan ruangan) {
		this.ruangan = ruangan;
	}

	public Integer getRuanganId() {
		return ruanganId;
	}

	public void setRuanganId(Integer ruanganId) {
		this.ruanganId = ruanganId;
	}

	public RegistrasiAset getRegistrasiAset() {
		return registrasiAset;
	}

	public void setRegistrasiAset(RegistrasiAset registrasiAset) {
		this.registrasiAset = registrasiAset;
	}

	public String getRegistrasiAsetId() {
		return registrasiAsetId;
	}

	public void setRegistrasiAsetId(String registrasiAsetId) {
		this.registrasiAsetId = registrasiAsetId;
	}
}
