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 WarnaProduk
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "WarnaProduk_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class WarnaProduk extends BaseMaster {
	@ManyToOne
	@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
	@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 Warna Produk tidak boleh kosong")
	@Column(name = "KdWarnaProduk", nullable = false)
	@Caption(value = "Kode Warna Produk")
	private Byte kdWarnaProduk;

	public void setKdWarnaProduk(Byte kdWarnaProduk) {
		this.kdWarnaProduk = kdWarnaProduk;
	}

	public Byte getKdWarnaProduk() {
		return this.kdWarnaProduk;
	}

	@NotNull(message = "QWarna Produk tidak boleh kosong")
	@Column(name = "QWarnaProduk", nullable = false)
	@Caption(value = "QWarna Produk")
	private Byte qWarnaProduk;

	public void setqWarnaProduk(Byte qWarnaProduk) {
		this.qWarnaProduk = qWarnaProduk;
	}

	public Byte getqWarnaProduk() {
		return this.qWarnaProduk;
	}

	@NotNull(message = "Warna Produk tidak boleh kosong")
	@Column(name = "WarnaProduk", nullable = false, length = 30)
	@Caption(value = "Warna Produk")
	private String warnaProduk;

	public void setWarnaProduk(String warnaProduk) {
		this.warnaProduk = warnaProduk;
	}

	public String getWarnaProduk() {
		return this.warnaProduk;
	}

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

	public Integer getId() {

		return id;
	}

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