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

	public void setAsalAnggaran(String asalAnggaran) {
		this.asalAnggaran = asalAnggaran;
	}

	public String getAsalAnggaran() {
		return this.asalAnggaran;
	}

	@Caption(value = "Kode Asal Anggaran")
	private Byte kdAsalAnggaran;

	@NotNull(message = "Kd Asal Anggaran tidak boleh kosong")
	@Column(name = "KdAsalAnggaran", nullable = false)
	public Byte getKdAsalAnggaran() {
		return kdAsalAnggaran;
	}

	public void setKdAsalAnggaran(Byte kdAsalAnggaran) {
		this.kdAsalAnggaran = kdAsalAnggaran;
	}

	@Column(name = "Keterangan", nullable = true, length = 100)
	@Caption(value = "Keterangan")
	private String keterangan;

	public void setKeterangan(String keterangan) {
		this.keterangan = keterangan;
	}

	public String getKeterangan() {
		return this.keterangan;
	}

	@Caption(value = "QAsal Anggaran")
	private Byte qAsalAnggaran;

	@NotNull(message = "QAsal Anggaran tidak boleh kosong")
	@Column(name = "QAsalAnggaran", nullable = false)
	public Byte getqAsalAnggaran() {
		return qAsalAnggaran;
	}

	public void setqAsalAnggaran(Byte qAsalAnggaran) {
		this.qAsalAnggaran = qAsalAnggaran;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL,
	 * mappedBy="kdasalanggaran") private Set<Anggaran> AnggaranSet = new
	 * HashSet<Anggaran>();
	 * 
	 * public Set<Anggaran> getAnggaranSet() { return AnggaranSet; }
	 * 
	 * public void setAnggaranSet(Set<Anggaran> anggaranSet) { AnggaranSet =
	 * anggaranSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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