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 JenisPajak
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "JenisPajak_M")
public class JenisPajak extends BaseMaster {
	@Column(name = "Deskripsi", nullable = true, length = 300)
	@Caption(value = "Deskripsi")
	private String deskripsi;

	public void setDeskripsi(String deskripsi) {
		this.deskripsi = deskripsi;
	}

	public String getDeskripsi() {
		return this.deskripsi;
	}

	@NotNull(message = "Jenis Pajak tidak boleh kosong")
	@Column(name = "JenisPajak", nullable = false, length = 50)
	@Caption(value = "Jenis Pajak")
	private String jenisPajak;

	public void setJenisPajak(String jenisPajak) {
		this.jenisPajak = jenisPajak;
	}

	public String getJenisPajak() {
		return this.jenisPajak;
	}

	@NotNull(message = "Kd Jenis Pajak tidak boleh kosong")
	@Column(name = "KdJenisPajak", nullable = false)
	@Caption(value = "Kode Jenis Pajak")
	private Byte kdJenisPajak;

	public void setKdJenisPajak(Byte kdJenisPajak) {
		this.kdJenisPajak = kdJenisPajak;
	}

	public Byte getKdJenisPajak() {
		return this.kdJenisPajak;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectJenisPajakHeadFk")

	@Caption(value = "Object Jenis Pajak Head")
	private JenisPajak jenisPajakHead;

	public void setJenisPajakHead(JenisPajak jenisPajakHead) {
		this.jenisPajakHead = jenisPajakHead;
	}

	public JenisPajak getJenisPajakHead() {
		return this.jenisPajakHead;
	}

	@Column(name = "ObjectJenisPajakHeadFk", insertable = false, updatable = false)
	private Integer jenisPajakHeadId;

	@NotNull(message = "QJenis Pajak tidak boleh kosong")
	@Column(name = "QJenisPajak", nullable = false)
	@Caption(value = "QJenis Pajak")
	private Byte qJenisPajak;

	public void setqJenisPajak(Byte qJenisPajak) {
		this.qJenisPajak = qJenisPajak;
	}

	public Byte getqJenisPajak() {
		return this.qJenisPajak;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdjenispajakhead") private Set<JenisPajak> JenisPajakSet = new
	 * HashSet<JenisPajak>();
	 * 
	 * public Set<JenisPajak> getJenisPajakSet() { return JenisPajakSet; }
	 * 
	 * public void setJenisPajakSet(Set<JenisPajak> jenisPajakSet) {
	 * JenisPajakSet = jenisPajakSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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