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

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

	@Caption(value = "Fungsi Produk")
	private String fungsiProduk;

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Object Departemen Harus Diisi")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

	@Column(name = "ObjectDepartemenFk", insertable = false, updatable = false)
	private Integer departemenId;

	@Caption(value = "Kode Fungsi Produk")
	private short kdFungsiProduk;

	@ManyToOne
	@JoinColumn(name = "ObjectKelompokProdukFk")
	@Caption(value = "Object Kelompok Produk")
	private KelompokProduk kelompokProduk;

	@Column(name = "ObjectKelompokProdukFk", insertable = false, updatable = false)
	private Integer kelompokProdukId;

	@Caption(value = "QFungsi Produk")
	private short qFungsiProduk;

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

}