package com.jasamedika.medifirst2000.entities;

import java.io.Serializable;
import org.hibernate.envers.Audited;
import java.util.HashSet;
import java.util.Set;

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 JenisPaket
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "JenisPaket_M")
public class JenisPaket extends BaseMaster {
	@NotNull(message = "Jenis Paket tidak boleh kosong")
	@Column(name = "JenisPaket", nullable = false, length = 50)
	@Caption(value = "Jenis Paket")
	private String jenisPaket;

	public void setJenisPaket(String jenisPaket) {
		this.jenisPaket = jenisPaket;
	}

	public String getJenisPaket() {
		return this.jenisPaket;
	}

	@NotNull(message = "Kd Jenis Paket tidak boleh kosong")
	@Column(name = "KdJenisPaket", nullable = false)
	@Caption(value = "Kode Jenis Paket")
	private Byte kdJenisPaket;

	public void setKdJenisPaket(Byte kdJenisPaket) {
		this.kdJenisPaket = kdJenisPaket;
	}

	public Byte getKdJenisPaket() {
		return this.kdJenisPaket;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectJenisPaketHeadFk")

	@Caption(value = "Object Jenis Paket Head")
	private JenisPaket jenisPaketHead;

	public void setJenisPaketHead(JenisPaket jenisPaketHead) {
		this.jenisPaketHead = jenisPaketHead;
	}

	public JenisPaket getJenisPaketHead() {
		return this.jenisPaketHead;
	}

	@Column(name = "ObjectJenisPaketHeadFk", insertable = false, updatable = false)
	private Integer jenisPaketHeadId;

	@NotNull(message = "QJenis Paket tidak boleh kosong")
	@Column(name = "QJenisPaket", nullable = false)
	@Caption(value = "QJenis Paket")
	private Byte qJenisPaket;

	public void setqJenisPaket(Byte qJenisPaket) {
		this.qJenisPaket = qJenisPaket;
	}

	public Byte getqJenisPaket() {
		return this.qJenisPaket;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdjenispakethead") private Set<JenisPaket> JenisPaketSet = new
	 * HashSet<JenisPaket>();
	 * 
	 * public Set<JenisPaket> getJenisPaketSet() { return JenisPaketSet; }
	 * 
	 * public void setJenisPaketSet(Set<JenisPaket> jenisPaketSet) {
	 * JenisPaketSet = jenisPaketSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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