/*
 * 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.TGENENOTACCOUNTINGDAY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenenotaccountingday.findAll", query = "SELECT t FROM Tgenenotaccountingday t"),
    @NamedQuery(name = "Tgenenotaccountingday.findByCatalog", query = "SELECT t FROM Tgenenotaccountingday t WHERE t.tgenenotaccountingdayPK.catalog = :catalog"),
    @NamedQuery(name = "Tgenenotaccountingday.findByDay", query = "SELECT t FROM Tgenenotaccountingday t WHERE t.tgenenotaccountingdayPK.day = :day"),
    @NamedQuery(name = "Tgenenotaccountingday.findByRecordversion", query = "SELECT t FROM Tgenenotaccountingday t WHERE t.recordversion = :recordversion")})
public class Tgenenotaccountingday implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenenotaccountingdayPK tgenenotaccountingdayPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @JoinColumns({
        @JoinColumn(name = "CATALOG", referencedColumnName = "CATALOG", insertable = false, updatable = false),
        @JoinColumn(name = "CATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail;

    public Tgenenotaccountingday() {
    }

    public Tgenenotaccountingday(TgenenotaccountingdayPK tgenenotaccountingdayPK) {
        this.tgenenotaccountingdayPK = tgenenotaccountingdayPK;
    }

    public Tgenenotaccountingday(String catalog, short day) {
        this.tgenenotaccountingdayPK = new TgenenotaccountingdayPK(catalog, day);
    }

    public TgenenotaccountingdayPK getTgenenotaccountingdayPK() {
        return tgenenotaccountingdayPK;
    }

    public void setTgenenotaccountingdayPK(TgenenotaccountingdayPK tgenenotaccountingdayPK) {
        this.tgenenotaccountingdayPK = tgenenotaccountingdayPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

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

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