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 LevelProduk
 * 
 * @author Generator
 */
@Getter
@Setter
@Entity
@Table(name = "LevelProduk_M")
public class LevelProduk extends BaseMaster {

	@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;

	@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 = "Kd Level Produk tidak boleh kosong")
	@Column(name = "KdLevelProduk", nullable = false)
	@Caption(value = "Kode Level Produk")
	private Byte kdLevelProduk;

	@NotNull(message = "Level Produk tidak boleh kosong")
	@Column(name = "LevelProduk", nullable = false, length = 30)
	@Caption(value = "Level Produk")
	private String levelProduk;

	@NotNull(message = "QLevel Produk tidak boleh kosong")
	@Column(name = "QLevelProduk", nullable = false)
	@Caption(value = "QLevel Produk")
	private Byte qLevelProduk;

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

}