/*
 * 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.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
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.TSAFEUSERDETAIL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tsafeuserdetail.findAll", query = "SELECT t FROM Tsafeuserdetail t"),
    @NamedQuery(name = "Tsafeuserdetail.findByUsercode", query = "SELECT t FROM Tsafeuserdetail t WHERE t.tsafeuserdetailPK.usercode = :usercode"),
    @NamedQuery(name = "Tsafeuserdetail.findByPersoncode", query = "SELECT t FROM Tsafeuserdetail t WHERE t.tsafeuserdetailPK.personcode = :personcode"),
    @NamedQuery(name = "Tsafeuserdetail.findByDateto", query = "SELECT t FROM Tsafeuserdetail t WHERE t.tsafeuserdetailPK.dateto = :dateto"),
    @NamedQuery(name = "Tsafeuserdetail.findByRecordversion", query = "SELECT t FROM Tsafeuserdetail t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tsafeuserdetail.findByDatefrom", query = "SELECT t FROM Tsafeuserdetail t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tsafeuserdetail.findByNickname", query = "SELECT t FROM Tsafeuserdetail t WHERE t.nickname = :nickname"),
    @NamedQuery(name = "Tsafeuserdetail.findByPassword", query = "SELECT t FROM Tsafeuserdetail t WHERE t.password = :password"),
    @NamedQuery(name = "Tsafeuserdetail.findByBranchfromterminal", query = "SELECT t FROM Tsafeuserdetail t WHERE t.branchfromterminal = :branchfromterminal"),
    @NamedQuery(name = "Tsafeuserdetail.findByChangepassword", query = "SELECT t FROM Tsafeuserdetail t WHERE t.changepassword = :changepassword"),
    @NamedQuery(name = "Tsafeuserdetail.findByIngressuser", query = "SELECT t FROM Tsafeuserdetail t WHERE t.ingressuser = :ingressuser"),
    @NamedQuery(name = "Tsafeuserdetail.findByModifyuser", query = "SELECT t FROM Tsafeuserdetail t WHERE t.modifyuser = :modifyuser"),
    @NamedQuery(name = "Tsafeuserdetail.findByActivateuser", query = "SELECT t FROM Tsafeuserdetail t WHERE t.activateuser = :activateuser"),
    @NamedQuery(name = "Tsafeuserdetail.findByIsuserbpm", query = "SELECT t FROM Tsafeuserdetail t WHERE t.isuserbpm = :isuserbpm"),
    @NamedQuery(name = "Tsafeuserdetail.findByCcentrocontrol", query = "SELECT t FROM Tsafeuserdetail t WHERE t.ccentrocontrol = :ccentrocontrol")})
public class Tsafeuserdetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TsafeuserdetailPK tsafeuserdetailPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Basic(optional = false)
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Basic(optional = false)
    @Column(name = "NICKNAME")
    private String nickname;
    @Column(name = "PASSWORD")
    private String password;
    @Column(name = "BRANCHFROMTERMINAL")
    private String branchfromterminal;
    @Column(name = "CHANGEPASSWORD")
    private String changepassword;
    @Column(name = "INGRESSUSER")
    private String ingressuser;
    @Column(name = "MODIFYUSER")
    private String modifyuser;
    @Column(name = "ACTIVATEUSER")
    private String activateuser;
    @Column(name = "ISUSERBPM")
    private String isuserbpm;
    @Column(name = "CCENTROCONTROL")
    private String ccentrocontrol;
    @JoinColumns({
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false, updatable = false),
        @JoinColumn(name = "AREACODE", referencedColumnName = "AREACODE")})
    @ManyToOne
    private Tgenearea tgenearea;
    @JoinColumns({
        @JoinColumn(name = "USERSTATUSCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "USERSTATUSCATALOGCODE", referencedColumnName = "CATALOGCODE", insertable = false)})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumn(name = "CHANNELCODE", referencedColumnName = "CHANNELCODE")
    @ManyToOne
    private Tgenechannels channelcode;
    @JoinColumn(name = "LANGUAGECODE", referencedColumnName = "LANGUAGECODE")
    @ManyToOne
    private Tgenelanguage languagecode;
    @JoinColumns({
        @JoinColumn(name = "OFFICECODE", referencedColumnName = "OFFICECODE"),
        @JoinColumn(name = "BRANCHCODE", referencedColumnName = "BRANCHCODE", insertable = false),
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false)})
    @ManyToOne
    private Tgeneoffice tgeneoffice;
    @JoinColumns({
        @JoinColumn(name = "TERMINALCODE", referencedColumnName = "TERMINALCODE"),
        @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false)})
    @ManyToOne
    private Tsafeterminal tsafeterminal;
    @JoinColumn(name = "USERCODE", referencedColumnName = "USERCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tsafeuser tsafeuser;

    public Tsafeuserdetail() {
    }

    public Tsafeuserdetail(TsafeuserdetailPK tsafeuserdetailPK) {
        this.tsafeuserdetailPK = tsafeuserdetailPK;
    }

    public Tsafeuserdetail(TsafeuserdetailPK tsafeuserdetailPK, Date datefrom, String nickname) {
        this.tsafeuserdetailPK = tsafeuserdetailPK;
        this.datefrom = datefrom;
        this.nickname = nickname;
    }

    public Tsafeuserdetail(String usercode, long personcode, Date dateto) {
        this.tsafeuserdetailPK = new TsafeuserdetailPK(usercode, personcode, dateto);
    }

    public TsafeuserdetailPK getTsafeuserdetailPK() {
        return tsafeuserdetailPK;
    }

    public void setTsafeuserdetailPK(TsafeuserdetailPK tsafeuserdetailPK) {
        this.tsafeuserdetailPK = tsafeuserdetailPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

    public void setRecordversion(BigInteger recordversion) {
        this.recordversion = recordversion;
    }

    public Date getDatefrom() {
        return datefrom;
    }

    public void setDatefrom(Date datefrom) {
        this.datefrom = datefrom;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getBranchfromterminal() {
        return branchfromterminal;
    }

    public void setBranchfromterminal(String branchfromterminal) {
        this.branchfromterminal = branchfromterminal;
    }

    public String getChangepassword() {
        return changepassword;
    }

    public void setChangepassword(String changepassword) {
        this.changepassword = changepassword;
    }

    public String getIngressuser() {
        return ingressuser;
    }

    public void setIngressuser(String ingressuser) {
        this.ingressuser = ingressuser;
    }

    public String getModifyuser() {
        return modifyuser;
    }

    public void setModifyuser(String modifyuser) {
        this.modifyuser = modifyuser;
    }

    public String getActivateuser() {
        return activateuser;
    }

    public void setActivateuser(String activateuser) {
        this.activateuser = activateuser;
    }

    public String getIsuserbpm() {
        return isuserbpm;
    }

    public void setIsuserbpm(String isuserbpm) {
        this.isuserbpm = isuserbpm;
    }

    public String getCcentrocontrol() {
        return ccentrocontrol;
    }

    public void setCcentrocontrol(String ccentrocontrol) {
        this.ccentrocontrol = ccentrocontrol;
    }

    public Tgenearea getTgenearea() {
        return tgenearea;
    }

    public void setTgenearea(Tgenearea tgenearea) {
        this.tgenearea = tgenearea;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

    public Tgenechannels getChannelcode() {
        return channelcode;
    }

    public void setChannelcode(Tgenechannels channelcode) {
        this.channelcode = channelcode;
    }

    public Tgenelanguage getLanguagecode() {
        return languagecode;
    }

    public void setLanguagecode(Tgenelanguage languagecode) {
        this.languagecode = languagecode;
    }

    public Tgeneoffice getTgeneoffice() {
        return tgeneoffice;
    }

    public void setTgeneoffice(Tgeneoffice tgeneoffice) {
        this.tgeneoffice = tgeneoffice;
    }

    public Tsafeterminal getTsafeterminal() {
        return tsafeterminal;
    }

    public void setTsafeterminal(Tsafeterminal tsafeterminal) {
        this.tsafeterminal = tsafeterminal;
    }

    public Tsafeuser getTsafeuser() {
        return tsafeuser;
    }

    public void setTsafeuser(Tsafeuser tsafeuser) {
        this.tsafeuser = tsafeuser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tsafeuserdetailPK != null ? tsafeuserdetailPK.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 Tsafeuserdetail)) {
            return false;
        }
        Tsafeuserdetail other = (Tsafeuserdetail) object;
        if ((this.tsafeuserdetailPK == null && other.tsafeuserdetailPK != null) || (this.tsafeuserdetailPK != null && !this.tsafeuserdetailPK.equals(other.tsafeuserdetailPK))) {
            return false;
        }
        return true;
    }

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