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.JsonIgnoreProperties;
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 SatuanKecil
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "SatuanKecil_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class SatuanKecil extends BaseMaster {
	@ManyToOne(fetch = FetchType.LAZY)
	@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;

	@ManyToOne(fetch = FetchType.LAZY)
	@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 = "Kd Satuan Kecil tidak boleh kosong")
	@Column(name = "KdSatuanKecil", nullable = false)
	@Caption(value = "Kode Satuan Kecil")
	private Byte kdSatuanKecil;

	public void setKdSatuanKecil(Byte kdSatuanKecil) {
		this.kdSatuanKecil = kdSatuanKecil;
	}

	public Byte getKdSatuanKecil() {
		return this.kdSatuanKecil;
	}

	@NotNull(message = "QSatuan Kecil tidak boleh kosong")
	@Column(name = "QSatuanKecil", nullable = false)
	@Caption(value = "QSatuan Kecil")
	private Byte qSatuanKecil;

	public void setqSatuanKecil(Byte qSatuanKecil) {
		this.qSatuanKecil = qSatuanKecil;
	}

	public Byte getqSatuanKecil() {
		return this.qSatuanKecil;
	}

	@NotNull(message = "Satuan Kecil tidak boleh kosong")
	@Column(name = "SatuanKecil", nullable = false, length = 20)
	@Caption(value = "Satuan Kecil")
	private String satuanKecil;

	public void setSatuanKecil(String satuanKecil) {
		this.satuanKecil = satuanKecil;
	}

	public String getSatuanKecil() {
		return this.satuanKecil;
	}

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

	public Integer getId() {

		return id;
	}

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