/*
 * 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.TGENEREPORTDETAIL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenereportdetail.findAll", query = "SELECT t FROM Tgenereportdetail t"),
    @NamedQuery(name = "Tgenereportdetail.findByReportcode", query = "SELECT t FROM Tgenereportdetail t WHERE t.tgenereportdetailPK.reportcode = :reportcode"),
    @NamedQuery(name = "Tgenereportdetail.findByModulecode", query = "SELECT t FROM Tgenereportdetail t WHERE t.tgenereportdetailPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgenereportdetail.findByReportparameter", query = "SELECT t FROM Tgenereportdetail t WHERE t.tgenereportdetailPK.reportparameter = :reportparameter"),
    @NamedQuery(name = "Tgenereportdetail.findByRecordversion", query = "SELECT t FROM Tgenereportdetail t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenereportdetail.findBySourceparameter", query = "SELECT t FROM Tgenereportdetail t WHERE t.sourceparameter = :sourceparameter"),
    @NamedQuery(name = "Tgenereportdetail.findByMandatory", query = "SELECT t FROM Tgenereportdetail t WHERE t.mandatory = :mandatory")})
public class Tgenereportdetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenereportdetailPK tgenereportdetailPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "SOURCEPARAMETER")
    private String sourceparameter;
    @Column(name = "MANDATORY")
    private String mandatory;
    @JoinColumns({
        @JoinColumn(name = "REPORTCODE", referencedColumnName = "REPORTCODE", insertable = false, updatable = false),
        @JoinColumn(name = "MODULECODE", referencedColumnName = "MODULECODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenereport tgenereport;

    public Tgenereportdetail() {
    }

    public Tgenereportdetail(TgenereportdetailPK tgenereportdetailPK) {
        this.tgenereportdetailPK = tgenereportdetailPK;
    }

    public Tgenereportdetail(String reportcode, String modulecode, String reportparameter) {
        this.tgenereportdetailPK = new TgenereportdetailPK(reportcode, modulecode, reportparameter);
    }

    public TgenereportdetailPK getTgenereportdetailPK() {
        return tgenereportdetailPK;
    }

    public void setTgenereportdetailPK(TgenereportdetailPK tgenereportdetailPK) {
        this.tgenereportdetailPK = tgenereportdetailPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getSourceparameter() {
        return sourceparameter;
    }

    public void setSourceparameter(String sourceparameter) {
        this.sourceparameter = sourceparameter;
    }

    public String getMandatory() {
        return mandatory;
    }

    public void setMandatory(String mandatory) {
        this.mandatory = mandatory;
    }

    public Tgenereport getTgenereport() {
        return tgenereport;
    }

    public void setTgenereport(Tgenereport tgenereport) {
        this.tgenereport = tgenereport;
    }

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

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