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 JenisPerawatan
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "JenisPerawatan_M")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class JenisPerawatan extends BaseMaster {
	@NotNull(message = "Jenis Perawatan tidak boleh kosong")
	@Column(name = "JenisPerawatan", nullable = false, length = 80)
	@Caption(value = "Jenis Perawatan")
	private String jenisPerawatan;

	public void setJenisPerawatan(String jenisPerawatan) {
		this.jenisPerawatan = jenisPerawatan;
	}

	public String getJenisPerawatan() {
		return this.jenisPerawatan;
	}

	@NotNull(message = "Kd Jenis Perawatan tidak boleh kosong")
	@Column(name = "KdJenisPerawatan", nullable = false)
	@Caption(value = "Kode Jenis Perawatan")
	private Byte kdJenisPerawatan;

	public void setKdJenisPerawatan(Byte kdJenisPerawatan) {
		this.kdJenisPerawatan = kdJenisPerawatan;
	}

	public Byte getKdJenisPerawatan() {
		return this.kdJenisPerawatan;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectJenisPerawatanHeadFk")

	@Caption(value = "Object Jenis Perawatan Head")
	private JenisPerawatan jenisPerawatanHead;

	public void setJenisPerawatanHead(JenisPerawatan jenisPerawatanHead) {
		this.jenisPerawatanHead = jenisPerawatanHead;
	}

	public JenisPerawatan getJenisPerawatanHead() {
		return this.jenisPerawatanHead;
	}

	@Column(name = "ObjectJenisPerawatanHeadFk", insertable = false, updatable = false)
	private Integer jenisPerawatanHeadId;

	@NotNull(message = "QJenis Perawatan tidak boleh kosong")
	@Column(name = "QJenisPerawatan", nullable = false)
	@Caption(value = "QJenis Perawatan")
	private Byte qJenisPerawatan;

	public void setqJenisPerawatan(Byte qJenisPerawatan) {
		this.qJenisPerawatan = qJenisPerawatan;
	}

	public Byte getqJenisPerawatan() {
		return this.qJenisPerawatan;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
	 * "kdjenisperawatan") private Set<Departemen> DepartemenSet = new
	 * HashSet<Departemen>();
	 * 
	 * public Set<Departemen> getDepartemenSet() { return DepartemenSet; }
	 * 
	 * public void setDepartemenSet(Set<Departemen> departemenSet) {
	 * DepartemenSet = departemenSet; }
	 * 
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdjenisperawatanhead") private Set<JenisPerawatan>
	 * JenisPerawatanSet = new HashSet<JenisPerawatan>();
	 * 
	 * public Set<JenisPerawatan> getJenisPerawatanSet() { return
	 * JenisPerawatanSet; }
	 * 
	 * public void setJenisPerawatanSet(Set<JenisPerawatan> jenisPerawatanSet) {
	 * JenisPerawatanSet = jenisPerawatanSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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