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 UnitLaporan
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "UnitLaporan_M")
public class UnitLaporan extends BaseMaster {
	@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;

	@NotNull(message = "Kd Unit Laporan tidak boleh kosong")
	@Column(name = "KdUnitLaporan", nullable = false)
	@Caption(value = "Kode Unit Laporan")
	private Byte kdUnitLaporan;

	public void setKdUnitLaporan(Byte kdUnitLaporan) {
		this.kdUnitLaporan = kdUnitLaporan;
	}

	public Byte getKdUnitLaporan() {
		return this.kdUnitLaporan;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectUnitLaporanHeadFk")

	@Caption(value = "Object Unit Laporan Head")
	private UnitLaporan unitLaporanHead;

	public void setUnitLaporanHead(UnitLaporan unitLaporanHead) {
		this.unitLaporanHead = unitLaporanHead;
	}

	public UnitLaporan getUnitLaporanHead() {
		return this.unitLaporanHead;
	}

	@Column(name = "ObjectUnitLaporanHeadFk", insertable = false, updatable = false)
	private Integer unitLaporanHeadId;

	@NotNull(message = "No Urut tidak boleh kosong")
	@Column(name = "NoUrut", nullable = false)
	@Caption(value = "No Urut")
	private Byte noUrut;

	public void setNoUrut(Byte noUrut) {
		this.noUrut = noUrut;
	}

	public Byte getNoUrut() {
		return this.noUrut;
	}

	@NotNull(message = "QUnit Laporan tidak boleh kosong")
	@Column(name = "QUnitLaporan", nullable = false)
	@Caption(value = "QUnit Laporan")
	private Byte qUnitLaporan;

	public void setqUnitLaporan(Byte qUnitLaporan) {
		this.qUnitLaporan = qUnitLaporan;
	}

	public Byte getqUnitLaporan() {
		return this.qUnitLaporan;
	}

	@NotNull(message = "Unit Laporan tidak boleh kosong")
	@Column(name = "UnitLaporan", nullable = false, length = 50)
	@Caption(value = "Unit Laporan")
	private String unitLaporan;

	public void setUnitLaporan(String unitLaporan) {
		this.unitLaporan = unitLaporan;
	}

	public String getUnitLaporan() {
		return this.unitLaporan;
	}

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

	public Integer getId() {

		return id;
	}

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