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

	public void setJenisOrganisasi(String jenisOrganisasi) {
		this.jenisOrganisasi = jenisOrganisasi;
	}

	public String getJenisOrganisasi() {
		return this.jenisOrganisasi;
	}

	@NotNull(message = "Kd Jenis Organisasi tidak boleh kosong")
	@Column(name = "KdJenisOrganisasi", nullable = false)
	@Caption(value = "Kode Jenis Organisasi")
	private Byte kdJenisOrganisasi;

	public void setKdJenisOrganisasi(Byte kdJenisOrganisasi) {
		this.kdJenisOrganisasi = kdJenisOrganisasi;
	}

	public Byte getKdJenisOrganisasi() {
		return this.kdJenisOrganisasi;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectJenisOrganisasiHeadFk")

	@Caption(value = "Object Jenis Organisasi Head")
	private JenisOrganisasi jenisOrganisasiHead;

	public void setJenisOrganisasiHead(JenisOrganisasi jenisOrganisasiHead) {
		this.jenisOrganisasiHead = jenisOrganisasiHead;
	}

	public JenisOrganisasi getJenisOrganisasiHead() {
		return this.jenisOrganisasiHead;
	}

	@Column(name = "ObjectJenisOrganisasiHeadFk", insertable = false, updatable = false)
	private Integer jenisOrganisasiHeadId;

	@NotNull(message = "QJenis Organisasi tidak boleh kosong")
	@Column(name = "QJenisOrganisasi", nullable = false)
	@Caption(value = "QJenis Organisasi")
	private Byte qJenisOrganisasi;

	public void setqJenisOrganisasi(Byte qJenisOrganisasi) {
		this.qJenisOrganisasi = qJenisOrganisasi;
	}

	public Byte getqJenisOrganisasi() {
		return this.qJenisOrganisasi;
	}
	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdjenisorganisasihead") private Set<JenisOrganisasi>
	 * JenisOrganisasiSet = new HashSet<JenisOrganisasi>();
	 * 
	 * public Set<JenisOrganisasi> getJenisOrganisasiSet() { return
	 * JenisOrganisasiSet; }
	 * 
	 * public void setJenisOrganisasiSet(Set<JenisOrganisasi>
	 * jenisOrganisasiSet) { JenisOrganisasiSet = jenisOrganisasiSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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