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 StrukturAccount
 * 
 * @author Generator
 */
@Entity // @Audited
@Table(name = "StrukturAccount_M")
public class StrukturAccount extends BaseMaster {
	@Column(name = "FormatAccount", nullable = true, length = 15)
	@Caption(value = "Format Account")
	private String formatAccount;

	public void setFormatAccount(String formatAccount) {
		this.formatAccount = formatAccount;
	}

	public String getFormatAccount() {
		return this.formatAccount;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectHistoryLoginIFk")
	@NotNull(message = "Kd History Login I tidak boleh kosong")

	@Caption(value = "Object History Login I")
	private HistoryLoginModulAplikasi historyLoginI;

	public void setHistoryLoginI(HistoryLoginModulAplikasi historyLoginI) {
		this.historyLoginI = historyLoginI;
	}

	public HistoryLoginModulAplikasi getHistoryLoginI() {
		return this.historyLoginI;
	}

	@Column(name = "ObjectHistoryLoginIFk", insertable = false, updatable = false)
	private Integer historyLoginIId;

	@ManyToOne
	@JoinColumn(name = "ObjectHistoryLoginSFk")

	@Caption(value = "Object History Login S")
	private HistoryLoginModulAplikasi historyLoginS;

	public void setHistoryLoginS(HistoryLoginModulAplikasi historyLoginS) {
		this.historyLoginS = historyLoginS;
	}

	public HistoryLoginModulAplikasi getHistoryLoginS() {
		return this.historyLoginS;
	}

	@Column(name = "ObjectHistoryLoginSFk", insertable = false, updatable = false, nullable = false)
	private Integer historyLoginSId;

	@ManyToOne
	@JoinColumn(name = "ObjectHistoryLoginUFk")

	@Caption(value = "Object History Login U")
	private HistoryLoginModulAplikasi historyLoginU;

	public void setHistoryLoginU(HistoryLoginModulAplikasi historyLoginU) {
		this.historyLoginU = historyLoginU;
	}

	public HistoryLoginModulAplikasi getHistoryLoginU() {
		return this.historyLoginU;
	}

	@Column(name = "ObjectHistoryLoginUFk", insertable = false, updatable = false)
	private Integer historyLoginUId;

	@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 Struktur Account tidak boleh kosong")
	@Column(name = "KdStrukturAccount", nullable = false)
	@Caption(value = "Kode Struktur Account")
	private Byte kdStrukturAccount;

	public void setKdStrukturAccount(Byte kdStrukturAccount) {
		this.kdStrukturAccount = kdStrukturAccount;
	}

	public Byte getKdStrukturAccount() {
		return this.kdStrukturAccount;
	}

	@NotNull(message = "Level Account tidak boleh kosong")
	@Column(name = "LevelAccount", nullable = false)
	@Caption(value = "Level Account")
	private Byte levelAccount;

	public void setLevelAccount(Byte levelAccount) {
		this.levelAccount = levelAccount;
	}

	public Byte getLevelAccount() {
		return this.levelAccount;
	}

	@NotNull(message = "No Urut Akhir tidak boleh kosong")
	@Column(name = "NoUrutAkhir", nullable = false)
	@Caption(value = "No Urut Akhir")
	private Byte noUrutAkhir;

	public void setNoUrutAkhir(Byte noUrutAkhir) {
		this.noUrutAkhir = noUrutAkhir;
	}

	public Byte getNoUrutAkhir() {
		return this.noUrutAkhir;
	}

	@NotNull(message = "No Urut Awal tidak boleh kosong")
	@Column(name = "NoUrutAwal", nullable = false)
	@Caption(value = "No Urut Awal")
	private Byte noUrutAwal;

	public void setNoUrutAwal(Byte noUrutAwal) {
		this.noUrutAwal = noUrutAwal;
	}

	public Byte getNoUrutAwal() {
		return this.noUrutAwal;
	}

	@NotNull(message = "Struktur Account tidak boleh kosong")
	@Column(name = "StrukturAccount", nullable = false, length = 80)
	@Caption(value = "Struktur Account")
	private String strukturAccount;

	public void setStrukturAccount(String strukturAccount) {
		this.strukturAccount = strukturAccount;
	}

	public String getStrukturAccount() {
		return this.strukturAccount;
	}

	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
	 * "kdstrukturaccount") 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.strukturaccount_m_id_seq")
	@javax.persistence.SequenceGenerator(name = "public.strukturaccount_m_id_seq", sequenceName = "public.strukturaccount_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

	public Integer getId() {

		return id;
	}

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