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 KategoryProduk
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "KategoryProduk_M")
public class KategoryProduk extends BaseMaster {
	@NotNull(message = "Kategory Produk tidak boleh kosong")
	@Column(name = "KategoryProduk", nullable = false, length = 30)
	@Caption(value = "Kategory Produk")
	private String kategoryProduk;

	public void setKategoryProduk(String kategoryProduk) {
		this.kategoryProduk = kategoryProduk;
	}

	public String getKategoryProduk() {
		return this.kategoryProduk;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Kd Departemen tidak boleh kosong")

	@Caption(value = "Object Departemen")
	private Departemen departemen;

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

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

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

	@NotNull(message = "Kd Kategory Produk tidak boleh kosong")
	@Column(name = "KdKategoryProduk", nullable = false)
	@Caption(value = "Kode Kategory Produk")
	private Byte kdKategoryProduk;

	public void setKdKategoryProduk(Byte kdKategoryProduk) {
		this.kdKategoryProduk = kdKategoryProduk;
	}

	public Byte getKdKategoryProduk() {
		return this.kdKategoryProduk;
	}

	@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, nullable = false)
	private Integer kelompokProdukId;

	@NotNull(message = "QKategory Produk tidak boleh kosong")
	@Column(name = "QKategoryProduk", nullable = false)
	@Caption(value = "QKategory Produk")
	private Byte qKategoryProduk;

	public void setqKategoryProduk(Byte qKategoryProduk) {
		this.qKategoryProduk = qKategoryProduk;
	}

	public Byte getqKategoryProduk() {
		return this.qKategoryProduk;
	}

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

	public Integer getId() {

		return id;
	}

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