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 KategoryAccount
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "KategoryAccount_M")
public class KategoryAccount extends BaseMaster {
	@NotNull(message = "Kategory Account tidak boleh kosong")
	@Column(name = "KategoryAccount", nullable = false, length = 30)
	@Caption(value = "Kategory Account")
	private String kategoryAccount;

	public void setKategoryAccount(String kategoryAccount) {
		this.kategoryAccount = kategoryAccount;
	}

	public String getKategoryAccount() {
		return this.kategoryAccount;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectJenisAccountFk")
	@NotNull(message = "Kd Jenis Account tidak boleh kosong")

	@Caption(value = "Object Jenis Account")
	private JenisAccount jenisAccount;

	public void setJenisAccount(JenisAccount jenisAccount) {
		this.jenisAccount = jenisAccount;
	}

	public JenisAccount getJenisAccount() {
		return this.jenisAccount;
	}

	@Column(name = "ObjectJenisAccountFk", insertable = false, updatable = false)
	private Integer jenisAccountId;

	@NotNull(message = "Kd Kategory Account tidak boleh kosong")
	@Column(name = "KdKategoryAccount", nullable = false)
	@Caption(value = "Kode Kategory Account")
	private Byte kdKategoryAccount;

	public void setKdKategoryAccount(Byte kdKategoryAccount) {
		this.kdKategoryAccount = kdKategoryAccount;
	}

	public Byte getKdKategoryAccount() {
		return this.kdKategoryAccount;
	}

	@NotNull(message = "QKategory Account tidak boleh kosong")
	@Column(name = "QKategoryAccount", nullable = false)
	@Caption(value = "QKategory Account")
	private Byte qKategoryAccount;

	public void setqKategoryAccount(Byte qKategoryAccount) {
		this.qKategoryAccount = qKategoryAccount;
	}

	public Byte getqKategoryAccount() {
		return this.qKategoryAccount;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
	 * "kdkategoryaccount") private Set<ChartOfAccount> ChartOfAccountSet = new
	 * HashSet<ChartOfAccount>();
	 * 
	 * public Set<ChartOfAccount> getChartOfAccountSet() { return
	 * ChartOfAccountSet; }
	 * 
	 * public void setChartOfAccountSet(Set<ChartOfAccount> chartOfAccountSet) {
	 * ChartOfAccountSet = chartOfAccountSet; }
	 */

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

	public Integer getId() {

		return id;
	}

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