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.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE;

@Getter
@Setter
@Entity
@Table(name = "MappingJenisLinenToProduk_M")
public class MappingJenisLinenToProduk extends BaseMaster {

	private static final long serialVersionUID = -2249080125161409771L;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "JenisLinenFk")
	@Caption(value = "JenisLinen")
	private JenisLinen jenisLinen;

	@Column(name = "JenisLinenFk", insertable = false, updatable = false)
	private Integer jenisLinenId;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "AlatFk")
	@Caption(value = "Alat")
	private Alat alat;

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

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ProdukFk")
	@Caption(value = "produk")
	private Produk produk;

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

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "SatuanStandarFk")
	@Caption(value = "SatuanStandar")
	private SatuanStandar satuanStandar;

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

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

	@Column(name = "qty")
	private Double qty;

}
