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

	@NotNull(message = "GDetail Jenis Produk tidak boleh kosong")
	@Column(name = "GDetailJenisProduk", nullable = false, length = 50)
	@Caption(value = "GDetail Jenis Produk")
	private String gDetailJenisProduk;

	@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 G Detail Jenis Produk tidak boleh kosong")
	@Column(name = "KdGDetailJenisProduk", nullable = false, length = 4)
	@Caption(value = "Kode G Detail Jenis Produk")
	private String kdGDetailJenisProduk;

	@ManyToOne
	@JoinColumn(name = "ObjectGJenisProdukFk")
	@NotNull(message = "Kd G Jenis Produk tidak boleh kosong")

	@Caption(value = "Object G Jenis Produk")
	private GeneralJenisProduk gJenisProduk;

	@Column(name = "ObjectGJenisProdukFk", insertable = false, updatable = false, nullable = false)
	private Integer gJenisProdukId;

	@NotNull(message = "QG Detail Jenis Produk tidak boleh kosong")
	@Column(name = "QGDetailJenisProduk", nullable = false)
	@Caption(value = "QG Detail Jenis Produk")
	private short qGDetailJenisProduk;

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

}