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

	public void setJenisHukuman(String jenisHukuman) {
		this.jenisHukuman = jenisHukuman;
	}

	public String getJenisHukuman() {
		return this.jenisHukuman;
	}

	@NotNull(message = "Kd Jenis Hukuman tidak boleh kosong")
	@Column(name = "KdJenisHukuman", nullable = false)
	@Caption(value = "Kode Jenis Hukuman")
	private Byte kdJenisHukuman;

	public void setKdJenisHukuman(Byte kdJenisHukuman) {
		this.kdJenisHukuman = kdJenisHukuman;
	}

	public Byte getKdJenisHukuman() {
		return this.kdJenisHukuman;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectJenisHukumanHeadFk")

	@Caption(value = "Object Jenis Hukuman Head")
	private JenisHukuman jenisHukumanHead;

	public void setJenisHukumanHead(JenisHukuman jenisHukumanHead) {
		this.jenisHukumanHead = jenisHukumanHead;
	}

	public JenisHukuman getJenisHukumanHead() {
		return this.jenisHukumanHead;
	}

	@Column(name = "ObjectJenisHukumanHeadFk", insertable = false, updatable = false)
	private Integer jenisHukumanHeadId;

	@NotNull(message = "QJenis Hukuman tidak boleh kosong")
	@Column(name = "QJenisHukuman", nullable = false)
	@Caption(value = "QJenis Hukuman")
	private Byte qJenisHukuman;

	public void setqJenisHukuman(Byte qJenisHukuman) {
		this.qJenisHukuman = qJenisHukuman;
	}

	public Byte getqJenisHukuman() {
		return this.qJenisHukuman;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdjenishukumanhead") private Set<JenisHukuman> JenisHukumanSet
	 * = new HashSet<JenisHukuman>();
	 * 
	 * public Set<JenisHukuman> getJenisHukumanSet() { return JenisHukumanSet; }
	 * 
	 * public void setJenisHukumanSet(Set<JenisHukuman> jenisHukumanSet) {
	 * JenisHukumanSet = jenisHukumanSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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