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

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TSAFEPROFILE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tsafeprofile.findAll", query = "SELECT t FROM Tsafeprofile t"),
    @NamedQuery(name = "Tsafeprofile.findByProfilecode", query = "SELECT t FROM Tsafeprofile t WHERE t.profilecode = :profilecode"),
    @NamedQuery(name = "Tsafeprofile.findByDescription", query = "SELECT t FROM Tsafeprofile t WHERE t.description = :description"),
    @NamedQuery(name = "Tsafeprofile.findByRecordversion", query = "SELECT t FROM Tsafeprofile t WHERE t.recordversion = :recordversion")})
public class Tsafeprofile implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PROFILECODE")
    private String profilecode;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tsafeprofile")
    private Collection<Tsafeuserprofile> tsafeuserprofileCollection;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "tsafeprofile")
    private Tgenemenuprofile tgenemenuprofile;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tsafeprofile")
    private Collection<Tsafeprofilehorary> tsafeprofilehoraryCollection;

    public Tsafeprofile() {
    }

    public Tsafeprofile(String profilecode) {
        this.profilecode = profilecode;
    }

    public Tsafeprofile(String profilecode, String description) {
        this.profilecode = profilecode;
        this.description = description;
    }

    public String getProfilecode() {
        return profilecode;
    }

    public void setProfilecode(String profilecode) {
        this.profilecode = profilecode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

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

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

    public Tgenemenuprofile getTgenemenuprofile() {
        return tgenemenuprofile;
    }

    public void setTgenemenuprofile(Tgenemenuprofile tgenemenuprofile) {
        this.tgenemenuprofile = tgenemenuprofile;
    }

    @XmlTransient
    public Collection<Tsafeprofilehorary> getTsafeprofilehoraryCollection() {
        return tsafeprofilehoraryCollection;
    }

    public void setTsafeprofilehoraryCollection(Collection<Tsafeprofilehorary> tsafeprofilehoraryCollection) {
        this.tsafeprofilehoraryCollection = tsafeprofilehoraryCollection;
    }

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

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