/*
 * 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.TCUSTPEOPLEINCOME")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustpeopleincome.findAll", query = "SELECT t FROM Tcustpeopleincome t"),
    @NamedQuery(name = "Tcustpeopleincome.findByPersoncode", query = "SELECT t FROM Tcustpeopleincome t WHERE t.tcustpeopleincomePK.personcode = :personcode"),
    @NamedQuery(name = "Tcustpeopleincome.findByDateto", query = "SELECT t FROM Tcustpeopleincome t WHERE t.tcustpeopleincomePK.dateto = :dateto"),
    @NamedQuery(name = "Tcustpeopleincome.findByIncomesequence", query = "SELECT t FROM Tcustpeopleincome t WHERE t.tcustpeopleincomePK.incomesequence = :incomesequence"),
    @NamedQuery(name = "Tcustpeopleincome.findByDatefrom", query = "SELECT t FROM Tcustpeopleincome t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustpeopleincome.findByRecordversion", query = "SELECT t FROM Tcustpeopleincome t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustpeopleincome.findByAmount", query = "SELECT t FROM Tcustpeopleincome t WHERE t.amount = :amount"),
    @NamedQuery(name = "Tcustpeopleincome.findByIsfixvalue", query = "SELECT t FROM Tcustpeopleincome t WHERE t.isfixvalue = :isfixvalue"),
    @NamedQuery(name = "Tcustpeopleincome.findByVerifiedamount", query = "SELECT t FROM Tcustpeopleincome t WHERE t.verifiedamount = :verifiedamount"),
    @NamedQuery(name = "Tcustpeopleincome.findByIngressusercode", query = "SELECT t FROM Tcustpeopleincome t WHERE t.ingressusercode = :ingressusercode"),
    @NamedQuery(name = "Tcustpeopleincome.findByModifyusercode", query = "SELECT t FROM Tcustpeopleincome t WHERE t.modifyusercode = :modifyusercode")})
public class Tcustpeopleincome implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustpeopleincomePK tcustpeopleincomePK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "AMOUNT")
    private BigDecimal amount;
    @Column(name = "ISFIXVALUE")
    private String isfixvalue;
    @Column(name = "VERIFIEDAMOUNT")
    private BigDecimal verifiedamount;
    @Column(name = "INGRESSUSERCODE")
    private String ingressusercode;
    @Column(name = "MODIFYUSERCODE")
    private String modifyusercode;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumns({
        @JoinColumn(name = "INCOMESCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "INCOMESCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE")
    @ManyToOne
    private Tgenecurrency currencycode;

    public Tcustpeopleincome() {
    }

    public Tcustpeopleincome(TcustpeopleincomePK tcustpeopleincomePK) {
        this.tcustpeopleincomePK = tcustpeopleincomePK;
    }

    public Tcustpeopleincome(long personcode, Date dateto, short incomesequence) {
        this.tcustpeopleincomePK = new TcustpeopleincomePK(personcode, dateto, incomesequence);
    }

    public TcustpeopleincomePK getTcustpeopleincomePK() {
        return tcustpeopleincomePK;
    }

    public void setTcustpeopleincomePK(TcustpeopleincomePK tcustpeopleincomePK) {
        this.tcustpeopleincomePK = tcustpeopleincomePK;
    }

    public Date getDatefrom() {
        return datefrom;
    }

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

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getIsfixvalue() {
        return isfixvalue;
    }

    public void setIsfixvalue(String isfixvalue) {
        this.isfixvalue = isfixvalue;
    }

    public BigDecimal getVerifiedamount() {
        return verifiedamount;
    }

    public void setVerifiedamount(BigDecimal verifiedamount) {
        this.verifiedamount = verifiedamount;
    }

    public String getIngressusercode() {
        return ingressusercode;
    }

    public void setIngressusercode(String ingressusercode) {
        this.ingressusercode = ingressusercode;
    }

    public String getModifyusercode() {
        return modifyusercode;
    }

    public void setModifyusercode(String modifyusercode) {
        this.modifyusercode = modifyusercode;
    }

    public Tcustperson getTcustperson() {
        return tcustperson;
    }

    public void setTcustperson(Tcustperson tcustperson) {
        this.tcustperson = tcustperson;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

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

    public Tgenecurrency getCurrencycode() {
        return currencycode;
    }

    public void setCurrencycode(Tgenecurrency currencycode) {
        this.currencycode = currencycode;
    }

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

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