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.Setter;

import javax.persistence.*;
import java.util.Date;

import static javax.persistence.FetchType.LAZY;

@Getter
@Setter
@Entity
@Table(name = "MappingPenerimaanLinen_T")
public class MappingPenerimaanLinen extends BaseTransaction {

	private static final long serialVersionUID = -3371759138279649454L;

	@JsonBackReference
	@ManyToOne
	@JoinColumn(name = "ObjectPenerimaanLinenFk")
	private PenerimaanLinen penerimaanLinen;

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

	@Column(name = "Tgl", nullable = false)
	@Caption(value = "Tgl")
	private Date tgl;

	@ManyToOne
	@JoinColumn(name = "ObjectRuanganFk")
	private Ruangan ruangan;

	@Column(name = "ObjectRuanganFk", insertable = false, updatable = false)
	private Integer ruanganId;

	@Column(name = "Berat", nullable = false)
	@Caption(value = "Berat")
	private Float berat;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectSatuanFk")
	private SatuanStandar satuan;

	@Column(name = "ObjectSatuanFk", insertable = false, updatable = false)
	private Integer satuanId;

}
