package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.jasamedika.medifirst2000.base.BaseTransaction;
import com.jasamedika.medifirst2000.helper.Caption;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

@Getter
@Setter
@NoArgsConstructor
@Entity
@Table(name = "HasilPemeriksaanSwaDetail_T")
public class HasilPemeriksaanSwaDetail extends BaseTransaction {

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectHasilPemeriksaanLimbahFk")
	@NotNull(message = "Hasil Pemeriksaan Limbah Cair harus diisi")
	@Caption(value = "Hasil Pemeriksaan Limbah Cair")
	@JsonBackReference
	private HasilPemeriksaanSwaPantauLimbahCair hasilPemeriksaanSwaPantauLimbahCair;

	@Column(name = "ObjectHasilPemeriksaanLimbahFk", columnDefinition = "CHAR(32)", insertable = false, updatable = false, nullable = false)
	private String hasilPemeriksaanSwaPantauLimbahCairId;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectParameterFk")
	@NotNull(message = "Parameter tidak boleh kosong")
	@Caption(value = "Object Parameter")
	private Parameter parameter;

	@Column(name = "ObjectParameterFk", insertable = false, updatable = false, nullable = false)
	private Integer parameterId;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ObjectSatuanStandarFk")
	@Caption(value = "Satuan")
	private SatuanStandar satuanStandar;

	@Column(name = "ObjectSatuanStandarFk", insertable = false, updatable = false)
	private Integer satuanStandarId;

	@Column(name = "Nilai")
	@Caption(value = "ilai")
	private Double nilai;

}
