package com.jasamedika.medifirst2000.entities;

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.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "MapAlatToProdukToBhp_m")
public class MapAlatToProdukToBhp extends BaseMaster {

	@ManyToOne
	@JoinColumn(name = "alatFk")
	@Caption(value = "Alat")
	private Alat alat;

	@Column(name = "alatFk", insertable = false, updatable = false, nullable = false)
	private Integer alatId;

	@ManyToOne
	@JoinColumn(name = "produkFk")
	@Caption(value = "produk")
	private Produk produk;

	@Column(name = "produkFk", insertable = false, updatable = false, nullable = false)
	private Integer produkId;

	@ManyToOne
	@JoinColumn(name = "produkBFk")
	@Caption(value = "produkB")
	private Produk produkB;

	@Column(name = "produkBFk", insertable = false, updatable = false, nullable = false)
	private Integer produkBId;

	@ManyToOne
	@JoinColumn(name = "satuanStandarBFk")
	@Caption(value = "satuanStandarB")
	private SatuanStandar satuanStandarB;

	@Column(name = "satuanStandarBFk", insertable = false, updatable = false, nullable = false)
	private Integer satuanStandarBId;

	@Caption(value = "qty ProdukB")
	@Column(name = "qtyProdukB", nullable = false)
	private Double qtyProdukB;

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

}
