/*
 * 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.TCUSTPEOPLEFIXEDINCOME")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustpeoplefixedincome.findAll", query = "SELECT t FROM Tcustpeoplefixedincome t"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByPersoncode", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.tcustpeoplefixedincomePK.personcode = :personcode"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByDateto", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.tcustpeoplefixedincomePK.dateto = :dateto"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByFixedincomesequence", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.tcustpeoplefixedincomePK.fixedincomesequence = :fixedincomesequence"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByDatefrom", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByRecordversion", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByBankname", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.bankname = :bankname"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByOriginalamont", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.originalamont = :originalamont"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByRate", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.rate = :rate"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByBalance", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.balance = :balance"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByBalancedate", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.balancedate = :balancedate"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByExpirationdate", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.expirationdate = :expirationdate"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByRemark", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.remark = :remark"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByIngressusercode", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.ingressusercode = :ingressusercode"),
    @NamedQuery(name = "Tcustpeoplefixedincome.findByModifyusercode", query = "SELECT t FROM Tcustpeoplefixedincome t WHERE t.modifyusercode = :modifyusercode")})
public class Tcustpeoplefixedincome implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustpeoplefixedincomePK tcustpeoplefixedincomePK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "BANKNAME")
    private String bankname;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "ORIGINALAMONT")
    private BigDecimal originalamont;
    @Column(name = "RATE")
    private BigDecimal rate;
    @Column(name = "BALANCE")
    private BigDecimal balance;
    @Column(name = "BALANCEDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date balancedate;
    @Column(name = "EXPIRATIONDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date expirationdate;
    @Column(name = "REMARK")
    private String remark;
    @Column(name = "INGRESSUSERCODE")
    private String ingressusercode;
    @Column(name = "MODIFYUSERCODE")
    private String modifyusercode;
    @JoinColumn(name = "BANKPERSONCODE", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson bankpersoncode;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumns({
        @JoinColumn(name = "FIXEDINCOMECATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "FIXEDINCOMECATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE")
    @ManyToOne
    private Tgenecurrency currencycode;

    public Tcustpeoplefixedincome() {
    }

    public Tcustpeoplefixedincome(TcustpeoplefixedincomePK tcustpeoplefixedincomePK) {
        this.tcustpeoplefixedincomePK = tcustpeoplefixedincomePK;
    }

    public Tcustpeoplefixedincome(long personcode, Date dateto, short fixedincomesequence) {
        this.tcustpeoplefixedincomePK = new TcustpeoplefixedincomePK(personcode, dateto, fixedincomesequence);
    }

    public TcustpeoplefixedincomePK getTcustpeoplefixedincomePK() {
        return tcustpeoplefixedincomePK;
    }

    public void setTcustpeoplefixedincomePK(TcustpeoplefixedincomePK tcustpeoplefixedincomePK) {
        this.tcustpeoplefixedincomePK = tcustpeoplefixedincomePK;
    }

    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 String getBankname() {
        return bankname;
    }

    public void setBankname(String bankname) {
        this.bankname = bankname;
    }

    public BigDecimal getOriginalamont() {
        return originalamont;
    }

    public void setOriginalamont(BigDecimal originalamont) {
        this.originalamont = originalamont;
    }

    public BigDecimal getRate() {
        return rate;
    }

    public void setRate(BigDecimal rate) {
        this.rate = rate;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public Date getBalancedate() {
        return balancedate;
    }

    public void setBalancedate(Date balancedate) {
        this.balancedate = balancedate;
    }

    public Date getExpirationdate() {
        return expirationdate;
    }

    public void setExpirationdate(Date expirationdate) {
        this.expirationdate = expirationdate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    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 getBankpersoncode() {
        return bankpersoncode;
    }

    public void setBankpersoncode(Tcustperson bankpersoncode) {
        this.bankpersoncode = bankpersoncode;
    }

    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 += (tcustpeoplefixedincomePK != null ? tcustpeoplefixedincomePK.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 Tcustpeoplefixedincome)) {
            return false;
        }
        Tcustpeoplefixedincome other = (Tcustpeoplefixedincome) object;
        if ((this.tcustpeoplefixedincomePK == null && other.tcustpeoplefixedincomePK != null) || (this.tcustpeoplefixedincomePK != null && !this.tcustpeoplefixedincomePK.equals(other.tcustpeoplefixedincomePK))) {
            return false;
        }
        return true;
    }

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