package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import javax.persistence.*;

import org.hibernate.validator.constraints.NotEmpty;

import com.jasamedika.medifirst2000.base.BaseMaster;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.internal.util.logging.Messages;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * class FungsiProduk
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "FungsiProduk_M")
public class FungsiProduk extends BaseMaster {
	@Caption(value = "Fungsi Produk")
	private String fungsiProduk;

	public void setFungsiProduk(String fungsiProduk) {
		this.fungsiProduk = fungsiProduk;
	}

	@NotNull(message = "Fungsi Produk tidak boleh kosong")
	@Column(name = "FungsiProduk", nullable = false, length = 100)
	public String getFungsiProduk() {
		return this.fungsiProduk;
	}

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

	public void setDepartemen(Departemen departemen) {
		this.departemen = departemen;
	}

	@NotNull(message = "Kd Departemen tidak boleh kosong")

	public Departemen getDepartemen() {
		return this.departemen;
	}

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

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

	public void setKdFungsiProduk(short kdFungsiProduk) {
		this.kdFungsiProduk = kdFungsiProduk;
	}

	@NotNull(message = "Kd Fungsi Produk tidak boleh kosong")
	@Column(name = "KdFungsiProduk", nullable = false)
	public short getKdFungsiProduk() {
		return this.kdFungsiProduk;
	}

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

	public void setKelompokProduk(KelompokProduk kelompokProduk) {
		this.kelompokProduk = kelompokProduk;
	}

	public KelompokProduk getKelompokProduk() {
		return this.kelompokProduk;
	}

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

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

	public void setqFungsiProduk(short qFungsiProduk) {
		this.qFungsiProduk = qFungsiProduk;
	}

	@NotNull(message = "QFungsi Produk tidak boleh kosong")
	@Column(name = "QFungsiProduk", nullable = false)
	public short getqFungsiProduk() {
		return this.qFungsiProduk;
	}

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

	public Integer getId() {

		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
}