package com.jasamedika.medifirst2000.entities;

import java.util.Date;

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

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

@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 = FetchType.LAZY)
	@JoinColumn(name = "ObjectSatuanFk")
	private SatuanStandar satuan;

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

	public PenerimaanLinen getPenerimaanLinen() {
		return penerimaanLinen;
	}

	public void setPenerimaanLinen(PenerimaanLinen penerimaanLinen) {
		this.penerimaanLinen = penerimaanLinen;
	}

	public Date getTgl() {
		return tgl;
	}

	public void setTgl(Date tgl) {
		this.tgl = tgl;
	}

	public Ruangan getRuangan() {
		return ruangan;
	}

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

	public Float getBerat() {
		return berat;
	}

	public void setBerat(Float berat) {
		this.berat = berat;
	}

	public SatuanStandar getSatuan() {
		return satuan;
	}

	public void setSatuan(SatuanStandar satuan) {
		this.satuan = satuan;
	}

}
