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 javax.validation.constraints.NotNull;

import static javax.persistence.FetchType.LAZY;
import static javax.persistence.GenerationType.SEQUENCE;

/**
 * class MapJenisDietToProduk
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "MapJenisDietToProduk_M")
public class MapJenisDietToProduk extends BaseMaster {

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

	@ManyToOne
	@JoinColumn(name = "ObjectJenisDietFk")
	@NotNull(message = "Kd JenisDiet tidak boleh kosong")
	@Caption(value = "Object Jenis Diet")
	private JenisDiet JenisDiet;

	@Column(name = "ObjectJenisDietFk", insertable = false, updatable = false)
	private Integer JenisDietId;

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")
	@NotNull(message = "Kd Produk tidak boleh kosong")
	@Caption(value = "Object Produk")
	private Produk produk;

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

	@Column(name = "Berat", length = 10)
	private String berat;

	@ManyToOne(fetch = LAZY)
	@JoinColumn(name = "ObjectJenisWaktuFk")
	private JenisWaktu jenisWaktu;

	@Column(name = "ObjectJenisWaktuFk", insertable = false, updatable = false)
	private Integer jenisWaktuId;

}