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 = "MappingAlatToBundle_M")
public class MappingAlatToBundle extends BaseMaster {

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectBundleSetAlatFk")
	@Caption(value = "Object Bundle Set Alat")
	private BundleSetAlat bundleSetAlat;

	@Column(name = "ObjectBundleSetAlatFk", insertable = false, updatable = false)
	private Integer bundleSetAlatId;

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

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

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

	@Column(name = "Satuan", length = 200)
	@Caption(value = "Satuan")
	private String satuan;

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

}