/*
 * 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.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

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

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CHANNELCODE")
    private String channelcode;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @OneToMany(mappedBy = "channelcode")
    private Collection<Tsafeuserdetail> tsafeuserdetailCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenechannels")
    private Collection<Tsafepassword> tsafepasswordCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenechannels")
    private Collection<Tgenechannelsdesc> tgenechannelsdescCollection;
    @OneToMany(mappedBy = "channelcode")
    private Collection<Tgenscheduleparameters> tgenscheduleparametersCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenechannels")
    private Collection<Tgenelabel> tgenelabelCollection;

    public Tgenechannels() {
    }

    public Tgenechannels(String channelcode) {
        this.channelcode = channelcode;
    }

    public String getChannelcode() {
        return channelcode;
    }

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

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getDescription() {
        return description;
    }

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

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

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

    @XmlTransient
    public Collection<Tsafepassword> getTsafepasswordCollection() {
        return tsafepasswordCollection;
    }

    public void setTsafepasswordCollection(Collection<Tsafepassword> tsafepasswordCollection) {
        this.tsafepasswordCollection = tsafepasswordCollection;
    }

    @XmlTransient
    public Collection<Tgenechannelsdesc> getTgenechannelsdescCollection() {
        return tgenechannelsdescCollection;
    }

    public void setTgenechannelsdescCollection(Collection<Tgenechannelsdesc> tgenechannelsdescCollection) {
        this.tgenechannelsdescCollection = tgenechannelsdescCollection;
    }

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

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

    @XmlTransient
    public Collection<Tgenelabel> getTgenelabelCollection() {
        return tgenelabelCollection;
    }

    public void setTgenelabelCollection(Collection<Tgenelabel> tgenelabelCollection) {
        this.tgenelabelCollection = tgenelabelCollection;
    }

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

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