/*
 * 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 javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEPROCESSDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneprocessdesc.findAll", query = "SELECT t FROM Tgeneprocessdesc t"),
    @NamedQuery(name = "Tgeneprocessdesc.findByProcesscode", query = "SELECT t FROM Tgeneprocessdesc t WHERE t.tgeneprocessdescPK.processcode = :processcode"),
    @NamedQuery(name = "Tgeneprocessdesc.findByCatalogtypeprocess", query = "SELECT t FROM Tgeneprocessdesc t WHERE t.tgeneprocessdescPK.catalogtypeprocess = :catalogtypeprocess"),
    @NamedQuery(name = "Tgeneprocessdesc.findByCatalogcodetypeprocess", query = "SELECT t FROM Tgeneprocessdesc t WHERE t.tgeneprocessdescPK.catalogcodetypeprocess = :catalogcodetypeprocess"),
    @NamedQuery(name = "Tgeneprocessdesc.findByLanguagecode", query = "SELECT t FROM Tgeneprocessdesc t WHERE t.tgeneprocessdescPK.languagecode = :languagecode"),
    @NamedQuery(name = "Tgeneprocessdesc.findByRecordversion", query = "SELECT t FROM Tgeneprocessdesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgeneprocessdesc.findByDescription", query = "SELECT t FROM Tgeneprocessdesc t WHERE t.description = :description")})
public class Tgeneprocessdesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneprocessdescPK tgeneprocessdescPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "LANGUAGECODE", referencedColumnName = "LANGUAGECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenelanguage tgenelanguage;
    @JoinColumns({
        @JoinColumn(name = "PROCESSCODE", referencedColumnName = "PROCESSCODE", insertable = false, updatable = false),
        @JoinColumn(name = "CATALOGTYPEPROCESS", referencedColumnName = "CATALOGTYPEPROCESS", insertable = false, updatable = false),
        @JoinColumn(name = "CATALOGCODETYPEPROCESS", referencedColumnName = "CATALOGCODETYPEPROCESS", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgeneprocess tgeneprocess;

    public Tgeneprocessdesc() {
    }

    public Tgeneprocessdesc(TgeneprocessdescPK tgeneprocessdescPK) {
        this.tgeneprocessdescPK = tgeneprocessdescPK;
    }

    public Tgeneprocessdesc(String processcode, String catalogtypeprocess, String catalogcodetypeprocess, String languagecode) {
        this.tgeneprocessdescPK = new TgeneprocessdescPK(processcode, catalogtypeprocess, catalogcodetypeprocess, languagecode);
    }

    public TgeneprocessdescPK getTgeneprocessdescPK() {
        return tgeneprocessdescPK;
    }

    public void setTgeneprocessdescPK(TgeneprocessdescPK tgeneprocessdescPK) {
        this.tgeneprocessdescPK = tgeneprocessdescPK;
    }

    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;
    }

    public Tgenelanguage getTgenelanguage() {
        return tgenelanguage;
    }

    public void setTgenelanguage(Tgenelanguage tgenelanguage) {
        this.tgenelanguage = tgenelanguage;
    }

    public Tgeneprocess getTgeneprocess() {
        return tgeneprocess;
    }

    public void setTgeneprocess(Tgeneprocess tgeneprocess) {
        this.tgeneprocess = tgeneprocess;
    }

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

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