/*
 * 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.TGENECATALOG")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenecatalog.findAll", query = "SELECT t FROM Tgenecatalog t"),
    @NamedQuery(name = "Tgenecatalog.findByCatalogcode", query = "SELECT t FROM Tgenecatalog t WHERE t.catalogcode = :catalogcode"),
    @NamedQuery(name = "Tgenecatalog.findByRecordversion", query = "SELECT t FROM Tgenecatalog t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenecatalog.findByDescription", query = "SELECT t FROM Tgenecatalog t WHERE t.description = :description")})
public class Tgenecatalog implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CATALOGCODE")
    private String catalogcode;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecatalog")
    private Collection<Tgenecatalogdesc> tgenecatalogdescCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecatalog")
    private Collection<Tgenecatalogdetail> tgenecatalogdetailCollection;

    public Tgenecatalog() {
    }

    public Tgenecatalog(String catalogcode) {
        this.catalogcode = catalogcode;
    }

    public Tgenecatalog(String catalogcode, String description) {
        this.catalogcode = catalogcode;
        this.description = description;
    }

    public String getCatalogcode() {
        return catalogcode;
    }

    public void setCatalogcode(String catalogcode) {
        this.catalogcode = catalogcode;
    }

    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<Tgenecatalogdesc> getTgenecatalogdescCollection() {
        return tgenecatalogdescCollection;
    }

    public void setTgenecatalogdescCollection(Collection<Tgenecatalogdesc> tgenecatalogdescCollection) {
        this.tgenecatalogdescCollection = tgenecatalogdescCollection;
    }

    @XmlTransient
    public Collection<Tgenecatalogdetail> getTgenecatalogdetailCollection() {
        return tgenecatalogdetailCollection;
    }

    public void setTgenecatalogdetailCollection(Collection<Tgenecatalogdetail> tgenecatalogdetailCollection) {
        this.tgenecatalogdetailCollection = tgenecatalogdetailCollection;
    }

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

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