/*
 * 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.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
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.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TCUSTBALANCEFINANCIAL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustbalancefinancial.findAll", query = "SELECT t FROM Tcustbalancefinancial t"),
    @NamedQuery(name = "Tcustbalancefinancial.findByPersoncode", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.tcustbalancefinancialPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustbalancefinancial.findByBalancedate", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.tcustbalancefinancialPK.balancedate = :balancedate"),
    @NamedQuery(name = "Tcustbalancefinancial.findByAccountcode", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.tcustbalancefinancialPK.accountcode = :accountcode"),
    @NamedQuery(name = "Tcustbalancefinancial.findByBalancecatalog", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.tcustbalancefinancialPK.balancecatalog = :balancecatalog"),
    @NamedQuery(name = "Tcustbalancefinancial.findByBalancecatalogcode", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.tcustbalancefinancialPK.balancecatalogcode = :balancecatalogcode"),
    @NamedQuery(name = "Tcustbalancefinancial.findByDateto", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.tcustbalancefinancialPK.dateto = :dateto"),
    @NamedQuery(name = "Tcustbalancefinancial.findByValueaccount", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.valueaccount = :valueaccount"),
    @NamedQuery(name = "Tcustbalancefinancial.findByDatefrom", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustbalancefinancial.findByIngressuser", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.ingressuser = :ingressuser"),
    @NamedQuery(name = "Tcustbalancefinancial.findByModifyuser", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.modifyuser = :modifyuser"),
    @NamedQuery(name = "Tcustbalancefinancial.findByRecordversion", query = "SELECT t FROM Tcustbalancefinancial t WHERE t.recordversion = :recordversion")})
public class Tcustbalancefinancial implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustbalancefinancialPK tcustbalancefinancialPK;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "VALUEACCOUNT")
    private BigDecimal valueaccount;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "INGRESSUSER")
    private String ingressuser;
    @Column(name = "MODIFYUSER")
    private String modifyuser;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @JoinColumns({
        @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false),
        @JoinColumn(name = "BALANCEDATE", referencedColumnName = "BALANCEDATE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tcustbalance tcustbalance;
    @JoinColumns({
        @JoinColumn(name = "ACCOUNTCODE", referencedColumnName = "ACCOUNTCODE", insertable = false, updatable = false),
        @JoinColumn(name = "BALANCECATALOG", referencedColumnName = "BALANCECATALOG", insertable = false, updatable = false),
        @JoinColumn(name = "BALANCECATALOGCODE", referencedColumnName = "BALANCECATALOGCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tcustbalanceaccount tcustbalanceaccount;

    public Tcustbalancefinancial() {
    }

    public Tcustbalancefinancial(TcustbalancefinancialPK tcustbalancefinancialPK) {
        this.tcustbalancefinancialPK = tcustbalancefinancialPK;
    }

    public Tcustbalancefinancial(long personcode, Date balancedate, String accountcode, String balancecatalog, String balancecatalogcode, Date dateto) {
        this.tcustbalancefinancialPK = new TcustbalancefinancialPK(personcode, balancedate, accountcode, balancecatalog, balancecatalogcode, dateto);
    }

    public TcustbalancefinancialPK getTcustbalancefinancialPK() {
        return tcustbalancefinancialPK;
    }

    public void setTcustbalancefinancialPK(TcustbalancefinancialPK tcustbalancefinancialPK) {
        this.tcustbalancefinancialPK = tcustbalancefinancialPK;
    }

    public BigDecimal getValueaccount() {
        return valueaccount;
    }

    public void setValueaccount(BigDecimal valueaccount) {
        this.valueaccount = valueaccount;
    }

    public Date getDatefrom() {
        return datefrom;
    }

    public void setDatefrom(Date datefrom) {
        this.datefrom = datefrom;
    }

    public String getIngressuser() {
        return ingressuser;
    }

    public void setIngressuser(String ingressuser) {
        this.ingressuser = ingressuser;
    }

    public String getModifyuser() {
        return modifyuser;
    }

    public void setModifyuser(String modifyuser) {
        this.modifyuser = modifyuser;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Tcustbalance getTcustbalance() {
        return tcustbalance;
    }

    public void setTcustbalance(Tcustbalance tcustbalance) {
        this.tcustbalance = tcustbalance;
    }

    public Tcustbalanceaccount getTcustbalanceaccount() {
        return tcustbalanceaccount;
    }

    public void setTcustbalanceaccount(Tcustbalanceaccount tcustbalanceaccount) {
        this.tcustbalanceaccount = tcustbalanceaccount;
    }

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

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