package com.jasamedika.medifirst2000.entities;

import com.fasterxml.jackson.annotation.JsonBackReference;
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 = "CssdBmhp_M")
public class CssdBmhp extends BaseMaster {

	@JsonBackReference
	@ManyToOne
	@Caption(value = "Cssd Alat")
	@JoinColumn(name = "ObjectCssdSetAlatFk")
	private CssdSetAlat cssdSetAlat;

	@Column(name = "ObjectCssdSetAlatFk", insertable = false, updatable = false)
	private Integer cssdSetAlatId;

	@ManyToOne
	@Caption(value = "Nama Barang")
	@JoinColumn(name = "ObjectNamaBarangFk")
	private Produk namaBarang;

	@Column(name = "ObjectNamaBarangFk", insertable = false, updatable = false)
	private Integer namaBarangId;

	@Column(name = "Jumlah")
	@Caption(value = "Jumlah")
	private Integer jumlah;

	@ManyToOne
	@Caption(value = "Satuan")
	@JoinColumn(name = "ObjectSatuanFk")
	private SatuanStandar satuan;

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

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

}