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 KategoryProduk
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@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;

	@ManyToOne
	@JoinColumn(name = "ObjectDepartemenFk")
	@NotNull(message = "Kd Departemen tidak boleh kosong")
	@Caption(value = "Object Departemen")
	private Departemen departemen;

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

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

	@ManyToOne
	@JoinColumn(name = "ObjectKelompokProdukFk")
	@Caption(value = "Object Kelompok Produk")
	private KelompokProduk 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;

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

}