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.Table;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;

/**
 *  class Paket
 * 
 * @author Generator
 */
@Entity //@Audited
@Table(name = "Paket_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class Paket extends BaseMaster {
	@ManyToOne
	@JoinColumn(name = "ObjectJenisPaketFk")
	@NotNull(message="Kd Jenis Paket tidak boleh kosong")

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

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


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

	@Column(name = "ObjectJenisPaketFk", insertable=false,updatable=false)
	private Integer jenisPaketId;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisTransaksiFk")
	@Caption(value="Object Jenis Transaksi")
	private JenisTransaksi jenisTransaksi;

	public void setJenisTransaksi(JenisTransaksi jenisTransaksi) {
		this.jenisTransaksi = jenisTransaksi;
	}


	public JenisTransaksi getJenisTransaksi(){
		return this.jenisTransaksi;
	}

	@Column(name = "ObjectJenisTransaksiFk", insertable=false,updatable=false,nullable=true)
	private Integer jenisTransaksiId;

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

	public void setKdPaket(Byte kdPaket) {
		this.kdPaket = kdPaket;
	}


	public Byte getKdPaket(){
		return this.kdPaket;
	}

	@NotNull(message="Nama Paket tidak boleh kosong")
	@Column(name = "NamaPaket", nullable = false , length = 50)
	@Caption(value="Nama Paket")
	private String namaPaket;

	public void setNamaPaket(String namaPaket) {
		this.namaPaket = namaPaket;
	}


	public String getNamaPaket(){
		return this.namaPaket;
	}

	@NotNull(message="QPaket tidak boleh kosong")
	@Column(name = "QPaket", nullable = false )
	@Caption(value="QPaket")
	private Byte qPaket;

	public void setqPaket(Byte qPaket) {
		this.qPaket = qPaket;
	}


	public Byte getqPaket(){
		return this.qPaket;
	}


	/*@JsonManagedReference
	@OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL, mappedBy="kdpaket")
	private Set<HargaPaketPenjamin> HargaPaketPenjaminSet = new HashSet<HargaPaketPenjamin>();

	public Set<HargaPaketPenjamin> getHargaPaketPenjaminSet() {
		return HargaPaketPenjaminSet;
	}

	public void setHargaPaketPenjaminSet(Set<HargaPaketPenjamin> hargaPaketPenjaminSet) {
		HargaPaketPenjaminSet = hargaPaketPenjaminSet;
	}
	

	@JsonManagedReference
	@OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL, mappedBy="kdpaket")
	private Set<HargaPaketPenjaminLuarPaket> HargaPaketPenjaminLuarPaketSet = new HashSet<HargaPaketPenjaminLuarPaket>();

	public Set<HargaPaketPenjaminLuarPaket> getHargaPaketPenjaminLuarPaketSet() {
		return HargaPaketPenjaminLuarPaketSet;
	}

	public void setHargaPaketPenjaminLuarPaketSet(Set<HargaPaketPenjaminLuarPaket> hargaPaketPenjaminLuarPaketSet) {
		HargaPaketPenjaminLuarPaketSet = hargaPaketPenjaminLuarPaketSet;
	}*/
	
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.paket_m_id_seq")
	@javax.persistence.SequenceGenerator(name = "public.paket_m_id_seq", sequenceName = "public.paket_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

	public Integer getId() {

		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name="harga")
	private Double harga;

	public Double getHarga() {
		return harga;
	}

	public void setHarga(Double harga) {
		this.harga = harga;
	}
	
	
}

