/*
 * 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.TGENETRANSACTIONDESC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenetransactiondesc.findAll", query = "SELECT t FROM Tgenetransactiondesc t"),
    @NamedQuery(name = "Tgenetransactiondesc.findByTransactionmodule", query = "SELECT t FROM Tgenetransactiondesc t WHERE t.tgenetransactiondescPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgenetransactiondesc.findByTransactioncode", query = "SELECT t FROM Tgenetransactiondesc t WHERE t.tgenetransactiondescPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgenetransactiondesc.findByTransactionversion", query = "SELECT t FROM Tgenetransactiondesc t WHERE t.tgenetransactiondescPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tgenetransactiondesc.findByLanguagecode", query = "SELECT t FROM Tgenetransactiondesc t WHERE t.tgenetransactiondescPK.languagecode = :languagecode"),
    @NamedQuery(name = "Tgenetransactiondesc.findByRecordversion", query = "SELECT t FROM Tgenetransactiondesc t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenetransactiondesc.findByDescription", query = "SELECT t FROM Tgenetransactiondesc t WHERE t.description = :description")})
public class Tgenetransactiondesc implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenetransactiondescPK tgenetransactiondescPK;
    @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 = "TRANSACTIONMODULE", referencedColumnName = "TRANSACTIONMODULE", insertable = false, updatable = false),
        @JoinColumn(name = "TRANSACTIONCODE", referencedColumnName = "TRANSACTIONCODE", insertable = false, updatable = false),
        @JoinColumn(name = "TRANSACTIONVERSION", referencedColumnName = "TRANSACTIONVERSION", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenetransaction tgenetransaction;

    public Tgenetransactiondesc() {
    }

    public Tgenetransactiondesc(TgenetransactiondescPK tgenetransactiondescPK) {
        this.tgenetransactiondescPK = tgenetransactiondescPK;
    }

    public Tgenetransactiondesc(String transactionmodule, short transactioncode, short transactionversion, String languagecode) {
        this.tgenetransactiondescPK = new TgenetransactiondescPK(transactionmodule, transactioncode, transactionversion, languagecode);
    }

    public TgenetransactiondescPK getTgenetransactiondescPK() {
        return tgenetransactiondescPK;
    }

    public void setTgenetransactiondescPK(TgenetransactiondescPK tgenetransactiondescPK) {
        this.tgenetransactiondescPK = tgenetransactiondescPK;
    }

    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 Tgenetransaction getTgenetransaction() {
        return tgenetransaction;
    }

    public void setTgenetransaction(Tgenetransaction tgenetransaction) {
        this.tgenetransaction = tgenetransaction;
    }

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

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