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 Hari
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "Hari_M")
public class Hari extends BaseMaster {
	@NotNull(message = "Kd Hari tidak boleh kosong")
	@Column(name = "KdHari", nullable = false)
	@Caption(value = "Kode Hari")
	private Byte kdHari;

	public void setKdHari(Byte kdHari) {
		this.kdHari = kdHari;
	}

	public Byte getKdHari() {
		return this.kdHari;
	}

	@NotNull(message = "Nama Hari tidak boleh kosong")
	@Column(name = "NamaHari", nullable = false, length = 10)
	@Caption(value = "Nama Hari")
	private String namaHari;

	public void setNamaHari(String namaHari) {
		this.namaHari = namaHari;
	}

	public String getNamaHari() {
		return this.namaHari;
	}

	@NotNull(message = "No Urut Hari Ke tidak boleh kosong")
	@Column(name = "NoUrutHariKe", nullable = false)
	@Caption(value = "No Urut Hari Ke")
	private Byte noUrutHariKe;

	public void setNoUrutHariKe(Byte noUrutHariKe) {
		this.noUrutHariKe = noUrutHariKe;
	}

	public Byte getNoUrutHariKe() {
		return this.noUrutHariKe;
	}

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

	public void setqHari(Byte qHari) {
		this.qHari = qHari;
	}

	public Byte getqHari() {
		return this.qHari;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdharilibur") private Set<HariLibur> HariLiburSet = new
	 * HashSet<HariLibur>();
	 * 
	 * public Set<HariLibur> getHariLiburSet() { return HariLiburSet; }
	 * 
	 * public void setHariLiburSet(Set<HariLibur> hariLiburSet) { HariLiburSet =
	 * hariLiburSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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