/*
 * 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.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TSAFEUSER")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tsafeuser.findAll", query = "SELECT t FROM Tsafeuser t"),
    @NamedQuery(name = "Tsafeuser.findByUsercode", query = "SELECT t FROM Tsafeuser t WHERE t.usercode = :usercode"),
    @NamedQuery(name = "Tsafeuser.findByInternalcode", query = "SELECT t FROM Tsafeuser t WHERE t.internalcode = :internalcode")})
public class Tsafeuser implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "USERCODE")
    private String usercode;
    @Column(name = "INTERNALCODE")
    private Integer internalcode;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tsafeuser")
    private Collection<Tbpmgroupsusers> tbpmgroupsusersCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tsafeuser")
    private Collection<Tsafeuserdetail> tsafeuserdetailCollection;
    @OneToMany(mappedBy = "modifyuser")
    private Collection<Tcustpersondetail> tcustpersondetailCollection;
    @OneToMany(mappedBy = "ingressuser")
    private Collection<Tcustpersondetail> tcustpersondetailCollection1;
    @OneToMany(mappedBy = "ingressusercode")
    private Collection<Tcustpersonaddress> tcustpersonaddressCollection;
    @OneToMany(mappedBy = "modifyusercode")
    private Collection<Tcustpersonaddress> tcustpersonaddressCollection1;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "usercode")
    private Collection<Tarmcashmanagementhistory> tarmcashmanagementhistoryCollection;
    @OneToMany(mappedBy = "usercode")
    private Collection<Tgeneschedulelog> tgeneschedulelogCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tsafeuser")
    private Collection<Tsafeuserprofile> tsafeuserprofileCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tsafeuser")
    private Collection<Tsafeusercompany> tsafeusercompanyCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tsafeuser")
    private Collection<Tsafeusersession> tsafeusersessionCollection;
    @OneToMany(mappedBy = "usercode")
    private Collection<Tbpmactivities> tbpmactivitiesCollection;
    @OneToMany(mappedBy = "usercode")
    private Collection<Tbpmtaskcomments> tbpmtaskcommentsCollection;
    @OneToMany(mappedBy = "ingressusercode")
    private Collection<Tcustpersonbankreference> tcustpersonbankreferenceCollection;
    @OneToMany(mappedBy = "modifyusercode")
    private Collection<Tcustpersonbankreference> tcustpersonbankreferenceCollection1;
    @OneToMany(mappedBy = "modifyuser")
    private Collection<Tgenefilesdetail> tgenefilesdetailCollection;
    @OneToMany(mappedBy = "ingressuser")
    private Collection<Tgenefilesdetail> tgenefilesdetailCollection1;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson personcode;
    @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE")
    @ManyToOne
    private Tgenecompany companycode;
    @OneToMany(mappedBy = "ingressusercode")
    private Collection<Tcustpersonphone> tcustpersonphoneCollection;
    @OneToMany(mappedBy = "modifyusercode")
    private Collection<Tcustpersonphone> tcustpersonphoneCollection1;
    @OneToMany(mappedBy = "modifyusercode")
    private Collection<Tcustpersonpersonalreference> tcustpersonpersonalreferenceCollection;
    @OneToMany(mappedBy = "ingressusercode")
    private Collection<Tcustpersonpersonalreference> tcustpersonpersonalreferenceCollection1;
    @OneToMany(mappedBy = "usercode")
    private Collection<Tgenscheduleparameters> tgenscheduleparametersCollection;
    @OneToMany(mappedBy = "usercode")
    private Collection<Tgeneaccountingdatebranch> tgeneaccountingdatebranchCollection;

    public Tsafeuser() {
    }

    public Tsafeuser(String usercode) {
        this.usercode = usercode;
    }

    public String getUsercode() {
        return usercode;
    }

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

    public Integer getInternalcode() {
        return internalcode;
    }

    public void setInternalcode(Integer internalcode) {
        this.internalcode = internalcode;
    }

    @XmlTransient
    public Collection<Tbpmgroupsusers> getTbpmgroupsusersCollection() {
        return tbpmgroupsusersCollection;
    }

    public void setTbpmgroupsusersCollection(Collection<Tbpmgroupsusers> tbpmgroupsusersCollection) {
        this.tbpmgroupsusersCollection = tbpmgroupsusersCollection;
    }

    @XmlTransient
    public Collection<Tsafeuserdetail> getTsafeuserdetailCollection() {
        return tsafeuserdetailCollection;
    }

    public void setTsafeuserdetailCollection(Collection<Tsafeuserdetail> tsafeuserdetailCollection) {
        this.tsafeuserdetailCollection = tsafeuserdetailCollection;
    }

    @XmlTransient
    public Collection<Tcustpersondetail> getTcustpersondetailCollection() {
        return tcustpersondetailCollection;
    }

    public void setTcustpersondetailCollection(Collection<Tcustpersondetail> tcustpersondetailCollection) {
        this.tcustpersondetailCollection = tcustpersondetailCollection;
    }

    @XmlTransient
    public Collection<Tcustpersondetail> getTcustpersondetailCollection1() {
        return tcustpersondetailCollection1;
    }

    public void setTcustpersondetailCollection1(Collection<Tcustpersondetail> tcustpersondetailCollection1) {
        this.tcustpersondetailCollection1 = tcustpersondetailCollection1;
    }

    @XmlTransient
    public Collection<Tcustpersonaddress> getTcustpersonaddressCollection() {
        return tcustpersonaddressCollection;
    }

    public void setTcustpersonaddressCollection(Collection<Tcustpersonaddress> tcustpersonaddressCollection) {
        this.tcustpersonaddressCollection = tcustpersonaddressCollection;
    }

    @XmlTransient
    public Collection<Tcustpersonaddress> getTcustpersonaddressCollection1() {
        return tcustpersonaddressCollection1;
    }

    public void setTcustpersonaddressCollection1(Collection<Tcustpersonaddress> tcustpersonaddressCollection1) {
        this.tcustpersonaddressCollection1 = tcustpersonaddressCollection1;
    }

    @XmlTransient
    public Collection<Tarmcashmanagementhistory> getTarmcashmanagementhistoryCollection() {
        return tarmcashmanagementhistoryCollection;
    }

    public void setTarmcashmanagementhistoryCollection(Collection<Tarmcashmanagementhistory> tarmcashmanagementhistoryCollection) {
        this.tarmcashmanagementhistoryCollection = tarmcashmanagementhistoryCollection;
    }

    @XmlTransient
    public Collection<Tgeneschedulelog> getTgeneschedulelogCollection() {
        return tgeneschedulelogCollection;
    }

    public void setTgeneschedulelogCollection(Collection<Tgeneschedulelog> tgeneschedulelogCollection) {
        this.tgeneschedulelogCollection = tgeneschedulelogCollection;
    }

    @XmlTransient
    public Collection<Tsafeuserprofile> getTsafeuserprofileCollection() {
        return tsafeuserprofileCollection;
    }

    public void setTsafeuserprofileCollection(Collection<Tsafeuserprofile> tsafeuserprofileCollection) {
        this.tsafeuserprofileCollection = tsafeuserprofileCollection;
    }

    @XmlTransient
    public Collection<Tsafeusercompany> getTsafeusercompanyCollection() {
        return tsafeusercompanyCollection;
    }

    public void setTsafeusercompanyCollection(Collection<Tsafeusercompany> tsafeusercompanyCollection) {
        this.tsafeusercompanyCollection = tsafeusercompanyCollection;
    }

    @XmlTransient
    public Collection<Tsafeusersession> getTsafeusersessionCollection() {
        return tsafeusersessionCollection;
    }

    public void setTsafeusersessionCollection(Collection<Tsafeusersession> tsafeusersessionCollection) {
        this.tsafeusersessionCollection = tsafeusersessionCollection;
    }

    @XmlTransient
    public Collection<Tbpmactivities> getTbpmactivitiesCollection() {
        return tbpmactivitiesCollection;
    }

    public void setTbpmactivitiesCollection(Collection<Tbpmactivities> tbpmactivitiesCollection) {
        this.tbpmactivitiesCollection = tbpmactivitiesCollection;
    }

    @XmlTransient
    public Collection<Tbpmtaskcomments> getTbpmtaskcommentsCollection() {
        return tbpmtaskcommentsCollection;
    }

    public void setTbpmtaskcommentsCollection(Collection<Tbpmtaskcomments> tbpmtaskcommentsCollection) {
        this.tbpmtaskcommentsCollection = tbpmtaskcommentsCollection;
    }

    @XmlTransient
    public Collection<Tcustpersonbankreference> getTcustpersonbankreferenceCollection() {
        return tcustpersonbankreferenceCollection;
    }

    public void setTcustpersonbankreferenceCollection(Collection<Tcustpersonbankreference> tcustpersonbankreferenceCollection) {
        this.tcustpersonbankreferenceCollection = tcustpersonbankreferenceCollection;
    }

    @XmlTransient
    public Collection<Tcustpersonbankreference> getTcustpersonbankreferenceCollection1() {
        return tcustpersonbankreferenceCollection1;
    }

    public void setTcustpersonbankreferenceCollection1(Collection<Tcustpersonbankreference> tcustpersonbankreferenceCollection1) {
        this.tcustpersonbankreferenceCollection1 = tcustpersonbankreferenceCollection1;
    }

    @XmlTransient
    public Collection<Tgenefilesdetail> getTgenefilesdetailCollection() {
        return tgenefilesdetailCollection;
    }

    public void setTgenefilesdetailCollection(Collection<Tgenefilesdetail> tgenefilesdetailCollection) {
        this.tgenefilesdetailCollection = tgenefilesdetailCollection;
    }

    @XmlTransient
    public Collection<Tgenefilesdetail> getTgenefilesdetailCollection1() {
        return tgenefilesdetailCollection1;
    }

    public void setTgenefilesdetailCollection1(Collection<Tgenefilesdetail> tgenefilesdetailCollection1) {
        this.tgenefilesdetailCollection1 = tgenefilesdetailCollection1;
    }

    public Tcustperson getPersoncode() {
        return personcode;
    }

    public void setPersoncode(Tcustperson personcode) {
        this.personcode = personcode;
    }

    public Tgenecompany getCompanycode() {
        return companycode;
    }

    public void setCompanycode(Tgenecompany companycode) {
        this.companycode = companycode;
    }

    @XmlTransient
    public Collection<Tcustpersonphone> getTcustpersonphoneCollection() {
        return tcustpersonphoneCollection;
    }

    public void setTcustpersonphoneCollection(Collection<Tcustpersonphone> tcustpersonphoneCollection) {
        this.tcustpersonphoneCollection = tcustpersonphoneCollection;
    }

    @XmlTransient
    public Collection<Tcustpersonphone> getTcustpersonphoneCollection1() {
        return tcustpersonphoneCollection1;
    }

    public void setTcustpersonphoneCollection1(Collection<Tcustpersonphone> tcustpersonphoneCollection1) {
        this.tcustpersonphoneCollection1 = tcustpersonphoneCollection1;
    }

    @XmlTransient
    public Collection<Tcustpersonpersonalreference> getTcustpersonpersonalreferenceCollection() {
        return tcustpersonpersonalreferenceCollection;
    }

    public void setTcustpersonpersonalreferenceCollection(Collection<Tcustpersonpersonalreference> tcustpersonpersonalreferenceCollection) {
        this.tcustpersonpersonalreferenceCollection = tcustpersonpersonalreferenceCollection;
    }

    @XmlTransient
    public Collection<Tcustpersonpersonalreference> getTcustpersonpersonalreferenceCollection1() {
        return tcustpersonpersonalreferenceCollection1;
    }

    public void setTcustpersonpersonalreferenceCollection1(Collection<Tcustpersonpersonalreference> tcustpersonpersonalreferenceCollection1) {
        this.tcustpersonpersonalreferenceCollection1 = tcustpersonpersonalreferenceCollection1;
    }

    @XmlTransient
    public Collection<Tgenscheduleparameters> getTgenscheduleparametersCollection() {
        return tgenscheduleparametersCollection;
    }

    public void setTgenscheduleparametersCollection(Collection<Tgenscheduleparameters> tgenscheduleparametersCollection) {
        this.tgenscheduleparametersCollection = tgenscheduleparametersCollection;
    }

    @XmlTransient
    public Collection<Tgeneaccountingdatebranch> getTgeneaccountingdatebranchCollection() {
        return tgeneaccountingdatebranchCollection;
    }

    public void setTgeneaccountingdatebranchCollection(Collection<Tgeneaccountingdatebranch> tgeneaccountingdatebranchCollection) {
        this.tgeneaccountingdatebranchCollection = tgeneaccountingdatebranchCollection;
    }

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

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