package com.jasamedika.medifirst2000.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;

/**
 * class HistoryLoginModulAplikasi
 * 
 * @author Generator
 */
@Entity
@Table(name = "HistoryLoginModulAplikasi_S")
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class HistoryLoginModulAplikasi extends BaseMaster {
	
	/**
	 * 
	 */
	//private static final long serialVersionUID = -3893896384067641807L;
	

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

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	@Caption(value = "Kode History Login")
	@NotNull(message = "Kd History Login tidak boleh kosong")
	@Column(name = "KdHistoryLogin", nullable = false)
	private Integer kdHistoryLogin;

	public void setKdHistoryLogin(Integer kdHistoryLogin) {
		this.kdHistoryLogin = kdHistoryLogin;
	}


	public Integer getKdHistoryLogin() {
		return this.kdHistoryLogin;
	}
	
	@NotNull(message = "Kd User tidak boleh kosong")
	@Caption(value = "Kode User")
	@Column(name = "KdUser", nullable = false, length = 5)
	private String kdUser;

	public void setKdUser(String kdUser) {
		this.kdUser = kdUser;
	}

	
	public String getKdUser() {
		return this.kdUser;
	}
	
	@Caption(value = "Id Pegawai")
	@Column(name = "IdPegawai")
	private Integer idPegawai;

	public void setIdPegawai(Integer idPegawai) {
		this.idPegawai = idPegawai;
	}

	
	public Integer getIdPegawai() {
		return this.idPegawai;
	}

	@Caption(value = "Nama Host")
	@NotNull(message = "Nama Host tidak boleh kosong")
	@Column(name = "NamaHost", nullable = false, length = 50)
	private String namaHost;

	public void setNamaHost(String namaHost) {
		this.namaHost = namaHost;
	}

	public String getNamaHost() {
		return this.namaHost;
	}

	@Caption(value = "Tanggal Login")
	@Column(name = "TglLogin", nullable = true)
	private Date tglLogin;

	public void setTglLogin(Date tglLogin) {
		this.tglLogin = tglLogin;
	}

	
	public Date getTglLogin() {
		return this.tglLogin;
	}

	@Caption(value = "Tanggal Logout")
	@Column(name = "TglLogout", nullable = true)
	private Date tglLogout;

	public void setTglLogout(Date tglLogout) {
		this.tglLogout = tglLogout;
	}

	public Date getTglLogout() {
		return this.tglLogout;
	}
	
	//
	// Foreign Key
	//
	
	
	@Column(name = "ObjectModulAplikasiFk", insertable = false, updatable = false)
	private Integer modulAplikasiId;
	
	public Integer getModulAplikasiId() {
		return modulAplikasiId;
	}

	public void setModulAplikasiId(Integer modulAplikasiId) {
		this.modulAplikasiId = modulAplikasiId;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectModulAplikasiFk")
	@Caption(value = "Object Modul Aplikasi")
	private ModulAplikasi modulAplikasi;

	public void setModulAplikasi(ModulAplikasi modulAplikasi) {
		this.modulAplikasi = modulAplikasi;
	}

	public ModulAplikasi getModulAplikasi() {
		return this.modulAplikasi;
	}


	@Column(name = "ObjectRuanganUserFk", insertable = false, updatable = false)
	private Integer ruanganUserId;
	
	public Integer getRuanganUserId() {
		return ruanganUserId;
	}

	public void setRuanganUserId(Integer ruanganUserId) {
		this.ruanganUserId = ruanganUserId;
	}

	@ManyToOne
	@JoinColumn(name = "ObjectRuanganUserFk")
	@NotNull(message = "Object Ruangan User Harus Diisi")
	@Caption(value = "Object Ruangan User")
	private Ruangan ruanganUser;

	public void setRuanganUser(Ruangan ruanganUser) {
		this.ruanganUser = ruanganUser;
	}

	@NotNull(message = "Kd Ruangan User tidak boleh kosong")
	public Ruangan getRuanganUser() {
		return this.ruanganUser;
	}


	/*
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
	 * "kdhistorylogind") private Set<Anggaran> AnggaranDSet = new
	 * HashSet<Anggaran>();
	 * 
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
	 * "kdhistorylogini") private Set<Anggaran> AnggaranISet = new
	 * HashSet<Anggaran>();
	 * 
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
	 * "kdhistorylogins") private Set<Anggaran> AnggaranSSet = new
	 * HashSet<Anggaran>();
	 * 
	 * @JsonManagedReference
	 * 
	 * @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy =
	 * "kdhistoryloginu") private Set<Anggaran> AnggaranUSet = new
	 * HashSet<Anggaran>();
	 * 
	 * public Set<Anggaran> getAnggaranUSet() { return AnggaranUSet; }
	 * 
	 * public void setAnggaranUSet(Set<Anggaran> anggaranUSet) { AnggaranUSet =
	 * anggaranUSet; }
	 * 
	 * public Set<Anggaran> getAnggaranDSet() { return AnggaranDSet; }
	 * 
	 * public void setAnggaranDSet(Set<Anggaran> anggaranDSet) { AnggaranDSet =
	 * anggaranDSet; }
	 * 
	 * public Set<Anggaran> getAnggaranISet() { return AnggaranISet; }
	 * 
	 * public void setAnggaranISet(Set<Anggaran> anggaranISet) { AnggaranISet =
	 * anggaranISet; }
	 * 
	 * public Set<Anggaran> getAnggaranSSet() { return AnggaranSSet; }
	 * 
	 * public void setAnggaranSSet(Set<Anggaran> anggaranSSet) { AnggaranSSet =
	 * anggaranSSet; }
	 */

}