/*
 * 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 javax.persistence.Basic;
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.TGENETRANSACTIONREPORTLINK")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenetransactionreportlink.findAll", query = "SELECT t FROM Tgenetransactionreportlink t"),
    @NamedQuery(name = "Tgenetransactionreportlink.findByTransactionmodule", query = "SELECT t FROM Tgenetransactionreportlink t WHERE t.tgenetransactionreportlinkPK.transactionmodule = :transactionmodule"),
    @NamedQuery(name = "Tgenetransactionreportlink.findByTransactioncode", query = "SELECT t FROM Tgenetransactionreportlink t WHERE t.tgenetransactionreportlinkPK.transactioncode = :transactioncode"),
    @NamedQuery(name = "Tgenetransactionreportlink.findByTransactionversion", query = "SELECT t FROM Tgenetransactionreportlink t WHERE t.tgenetransactionreportlinkPK.transactionversion = :transactionversion"),
    @NamedQuery(name = "Tgenetransactionreportlink.findByCompanycode", query = "SELECT t FROM Tgenetransactionreportlink t WHERE t.tgenetransactionreportlinkPK.companycode = :companycode"),
    @NamedQuery(name = "Tgenetransactionreportlink.findByPersistenceunit", query = "SELECT t FROM Tgenetransactionreportlink t WHERE t.persistenceunit = :persistenceunit"),
    @NamedQuery(name = "Tgenetransactionreportlink.findByReportname", query = "SELECT t FROM Tgenetransactionreportlink t WHERE t.reportname = :reportname")})
public class Tgenetransactionreportlink implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenetransactionreportlinkPK tgenetransactionreportlinkPK;
    @Column(name = "PERSISTENCEUNIT")
    private String persistenceunit;
    @Basic(optional = false)
    @Column(name = "REPORTNAME")
    private String reportname;
    @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenecompany tgenecompany;
    @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 Tgenetransactionreportlink() {
    }

    public Tgenetransactionreportlink(TgenetransactionreportlinkPK tgenetransactionreportlinkPK) {
        this.tgenetransactionreportlinkPK = tgenetransactionreportlinkPK;
    }

    public Tgenetransactionreportlink(TgenetransactionreportlinkPK tgenetransactionreportlinkPK, String reportname) {
        this.tgenetransactionreportlinkPK = tgenetransactionreportlinkPK;
        this.reportname = reportname;
    }

    public Tgenetransactionreportlink(String transactionmodule, short transactioncode, short transactionversion, long companycode) {
        this.tgenetransactionreportlinkPK = new TgenetransactionreportlinkPK(transactionmodule, transactioncode, transactionversion, companycode);
    }

    public TgenetransactionreportlinkPK getTgenetransactionreportlinkPK() {
        return tgenetransactionreportlinkPK;
    }

    public void setTgenetransactionreportlinkPK(TgenetransactionreportlinkPK tgenetransactionreportlinkPK) {
        this.tgenetransactionreportlinkPK = tgenetransactionreportlinkPK;
    }

    public String getPersistenceunit() {
        return persistenceunit;
    }

    public void setPersistenceunit(String persistenceunit) {
        this.persistenceunit = persistenceunit;
    }

    public String getReportname() {
        return reportname;
    }

    public void setReportname(String reportname) {
        this.reportname = reportname;
    }

    public Tgenecompany getTgenecompany() {
        return tgenecompany;
    }

    public void setTgenecompany(Tgenecompany tgenecompany) {
        this.tgenecompany = tgenecompany;
    }

    public Tgenetransaction getTgenetransaction() {
        return tgenetransaction;
    }

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

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

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