/*
 * 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.TGENEFREQUENCY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenefrequency.findAll", query = "SELECT t FROM Tgenefrequency t"),
    @NamedQuery(name = "Tgenefrequency.findByFrecqencycode", query = "SELECT t FROM Tgenefrequency t WHERE t.frecqencycode = :frecqencycode"),
    @NamedQuery(name = "Tgenefrequency.findByRecordversion", query = "SELECT t FROM Tgenefrequency t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenefrequency.findByDays", query = "SELECT t FROM Tgenefrequency t WHERE t.days = :days"),
    @NamedQuery(name = "Tgenefrequency.findByDescription", query = "SELECT t FROM Tgenefrequency t WHERE t.description = :description")})
public class Tgenefrequency implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "FRECQENCYCODE")
    private Short frecqencycode;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Basic(optional = false)
    @Column(name = "DAYS")
    private short days;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenefrequency")
    private Collection<Tgenefrequencydesc> tgenefrequencydescCollection;

    public Tgenefrequency() {
    }

    public Tgenefrequency(Short frecqencycode) {
        this.frecqencycode = frecqencycode;
    }

    public Tgenefrequency(Short frecqencycode, short days, String description) {
        this.frecqencycode = frecqencycode;
        this.days = days;
        this.description = description;
    }

    public Short getFrecqencycode() {
        return frecqencycode;
    }

    public void setFrecqencycode(Short frecqencycode) {
        this.frecqencycode = frecqencycode;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public short getDays() {
        return days;
    }

    public void setDays(short days) {
        this.days = days;
    }

    public String getDescription() {
        return description;
    }

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

    @XmlTransient
    public Collection<Tgenefrequencydesc> getTgenefrequencydescCollection() {
        return tgenefrequencydescCollection;
    }

    public void setTgenefrequencydescCollection(Collection<Tgenefrequencydesc> tgenefrequencydescCollection) {
        this.tgenefrequencydescCollection = tgenefrequencydescCollection;
    }

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

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