package com.jasamedika.medifirst2000.entities;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
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;

/**
 * class JenisKemasan
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "JenisKemasan_M")
public class JenisKemasan extends BaseMaster {
	@NotNull(message = "Jenis Kemasan tidak boleh kosong")
	@Column(name = "JenisKemasan", nullable = false, length = 30)
	@Caption(value = "Jenis Kemasan")
	private String jenisKemasan;

	public void setJenisKemasan(String jenisKemasan) {
		this.jenisKemasan = jenisKemasan;
	}

	public String getJenisKemasan() {
		return this.jenisKemasan;
	}

	@NotNull(message = "Kd Jenis Kemasan tidak boleh kosong")
	@Column(name = "KdJenisKemasan", nullable = false)
	@Caption(value = "Kode Jenis Kemasan")
	private Byte kdJenisKemasan;

	public void setKdJenisKemasan(Byte kdJenisKemasan) {
		this.kdJenisKemasan = kdJenisKemasan;
	}

	public Byte getKdJenisKemasan() {
		return this.kdJenisKemasan;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectProdukFk")

	@Caption(value = "Object Produk")
	private Produk produk;

	public void setProduk(Produk produk) {
		this.produk = produk;
	}

	public Produk getProduk() {
		return this.produk;
	}

	@Column(name = "ObjectProdukFk", insertable = false, updatable = false)
	private Integer produkId;

	@Column(name = "IsRacikan", nullable = true)
	@Caption(value = "Is Racikan")
	private Boolean isRacikan;

	public Boolean getIsRacikan() {
		return isRacikan;
	}

	public void setIsRacikan(Boolean isRacikan) {
		this.isRacikan = isRacikan;
	}

	@NotNull(message = "QJenis Kemasan tidak boleh kosong")
	@Column(name = "QJenisKemasan", nullable = false)
	@Caption(value = "QJenis Kemasan")
	private Byte qJenisKemasan;

	public void setqJenisKemasan(Byte qJenisKemasan) {
		this.qJenisKemasan = qJenisKemasan;
	}

	public Byte getqJenisKemasan() {
		return this.qJenisKemasan;
	}

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

	public Integer getId() {

		return id;
	}

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