/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.qsoft.rs.sincoar.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TSAFEUSERSESSIONLOG")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tsafeusersessionlog.findAll", query = "SELECT t FROM Tsafeusersessionlog t"),
    @NamedQuery(name = "Tsafeusersessionlog.findByCompanycode", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.tsafeusersessionlogPK.companycode = :companycode"),
    @NamedQuery(name = "Tsafeusersessionlog.findByWorkingdate", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.tsafeusersessionlogPK.workingdate = :workingdate"),
    @NamedQuery(name = "Tsafeusersessionlog.findBySequence", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.tsafeusersessionlogPK.sequence = :sequence"),
    @NamedQuery(name = "Tsafeusersessionlog.findByUsercode", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.usercode = :usercode"),
    @NamedQuery(name = "Tsafeusersessionlog.findByBranchcode", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.branchcode = :branchcode"),
    @NamedQuery(name = "Tsafeusersessionlog.findByOfficecode", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.officecode = :officecode"),
    @NamedQuery(name = "Tsafeusersessionlog.findByTerminalcode", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.terminalcode = :terminalcode"),
    @NamedQuery(name = "Tsafeusersessionlog.findBySessionid", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.sessionid = :sessionid"),
    @NamedQuery(name = "Tsafeusersessionlog.findByWebserverip", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.webserverip = :webserverip"),
    @NamedQuery(name = "Tsafeusersessionlog.findByRealdate", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.realdate = :realdate"),
    @NamedQuery(name = "Tsafeusersessionlog.findByErrorcode", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.errorcode = :errorcode"),
    @NamedQuery(name = "Tsafeusersessionlog.findByMessagelogin", query = "SELECT t FROM Tsafeusersessionlog t WHERE t.messagelogin = :messagelogin")})
public class Tsafeusersessionlog implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TsafeusersessionlogPK tsafeusersessionlogPK;
    @Basic(optional = false)
    @Column(name = "USERCODE")
    private String usercode;
    @Column(name = "BRANCHCODE")
    private Short branchcode;
    @Column(name = "OFFICECODE")
    private Short officecode;
    @Basic(optional = false)
    @Column(name = "TERMINALCODE")
    private String terminalcode;
    @Basic(optional = false)
    @Column(name = "SESSIONID")
    private String sessionid;
    @Basic(optional = false)
    @Column(name = "WEBSERVERIP")
    private String webserverip;
    @Basic(optional = false)
    @Column(name = "REALDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date realdate;
    @Basic(optional = false)
    @Column(name = "ERRORCODE")
    private String errorcode;
    @Basic(optional = false)
    @Column(name = "MESSAGELOGIN")
    private String messagelogin;

    public Tsafeusersessionlog() {
    }

    public Tsafeusersessionlog(TsafeusersessionlogPK tsafeusersessionlogPK) {
        this.tsafeusersessionlogPK = tsafeusersessionlogPK;
    }

    public Tsafeusersessionlog(TsafeusersessionlogPK tsafeusersessionlogPK, String usercode, String terminalcode, String sessionid, String webserverip, Date realdate, String errorcode, String messagelogin) {
        this.tsafeusersessionlogPK = tsafeusersessionlogPK;
        this.usercode = usercode;
        this.terminalcode = terminalcode;
        this.sessionid = sessionid;
        this.webserverip = webserverip;
        this.realdate = realdate;
        this.errorcode = errorcode;
        this.messagelogin = messagelogin;
    }

    public Tsafeusersessionlog(int companycode, Date workingdate, int sequence) {
        this.tsafeusersessionlogPK = new TsafeusersessionlogPK(companycode, workingdate, sequence);
    }

    public TsafeusersessionlogPK getTsafeusersessionlogPK() {
        return tsafeusersessionlogPK;
    }

    public void setTsafeusersessionlogPK(TsafeusersessionlogPK tsafeusersessionlogPK) {
        this.tsafeusersessionlogPK = tsafeusersessionlogPK;
    }

    public String getUsercode() {
        return usercode;
    }

    public void setUsercode(String usercode) {
        this.usercode = usercode;
    }

    public Short getBranchcode() {
        return branchcode;
    }

    public void setBranchcode(Short branchcode) {
        this.branchcode = branchcode;
    }

    public Short getOfficecode() {
        return officecode;
    }

    public void setOfficecode(Short officecode) {
        this.officecode = officecode;
    }

    public String getTerminalcode() {
        return terminalcode;
    }

    public void setTerminalcode(String terminalcode) {
        this.terminalcode = terminalcode;
    }

    public String getSessionid() {
        return sessionid;
    }

    public void setSessionid(String sessionid) {
        this.sessionid = sessionid;
    }

    public String getWebserverip() {
        return webserverip;
    }

    public void setWebserverip(String webserverip) {
        this.webserverip = webserverip;
    }

    public Date getRealdate() {
        return realdate;
    }

    public void setRealdate(Date realdate) {
        this.realdate = realdate;
    }

    public String getErrorcode() {
        return errorcode;
    }

    public void setErrorcode(String errorcode) {
        this.errorcode = errorcode;
    }

    public String getMessagelogin() {
        return messagelogin;
    }

    public void setMessagelogin(String messagelogin) {
        this.messagelogin = messagelogin;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tsafeusersessionlogPK != null ? tsafeusersessionlogPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tsafeusersessionlog)) {
            return false;
        }
        Tsafeusersessionlog other = (Tsafeusersessionlog) object;
        if ((this.tsafeusersessionlogPK == null && other.tsafeusersessionlogPK != null) || (this.tsafeusersessionlogPK != null && !this.tsafeusersessionlogPK.equals(other.tsafeusersessionlogPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qsoft.rs.sincoar.model.Tsafeusersessionlog[ tsafeusersessionlogPK=" + tsafeusersessionlogPK + " ]";
    }
    
}
