package com.jasamedika.medifirst2000.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.jasamedika.medifirst2000.base.BaseActive;
import com.jasamedika.medifirst2000.helper.Caption;

@Entity
@Table(name = "produknakes_m")
public class ProdukNakes extends BaseActive {

	@NotNull(message = "Nama Produk tidak boleh kosong")
	@Column(name = "namaproduk", nullable = false)
	@Caption(value = "Nama Produk")
	private String namaProduk;

	/*
	 * 1-Pelayanan Pasien, 2-Nonpelayanan Pasien
	 */
	@NotNull(message = "Kode Produk tidak boleh kosong")
	@Column(name = "kdproduk", nullable = false)
	@Caption(value = "Kode Produk")
	private Short kdProduk;

	@ManyToOne
	@NotNull(message = "Profesi tidak boleh kosong")
	@JoinColumn(name = "objectprofesifk")
	@Caption(value = "Profesi")
	private Profesi profesi;

	@Column(name = "objectprofesifk", insertable = false, updatable = false, nullable = false)
	private Integer profesiId;

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

	public String getNamaProduk() {
		return namaProduk;
	}

	public void setNamaProduk(String namaProduk) {
		this.namaProduk = namaProduk;
	}

	public Short getKdProduk() {
		return kdProduk;
	}

	public void setKdProduk(Short kdProduk) {
		this.kdProduk = kdProduk;
	}

	public Profesi getProfesi() {
		return profesi;
	}

	public void setProfesi(Profesi profesi) {
		this.profesi = profesi;
	}

	public Integer getProfesiId() {
		return profesiId;
	}

	public void setProfesiId(Integer profesiId) {
		this.profesiId = profesiId;
	}

	public Integer getId() {
		return id;
	}

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

}
