/*
 * 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.TCUSTPEOPLEREALASSETS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustpeoplerealassets.findAll", query = "SELECT t FROM Tcustpeoplerealassets t"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByPersoncode", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.tcustpeoplerealassetsPK.personcode = :personcode"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByDateto", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.tcustpeoplerealassetsPK.dateto = :dateto"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByAssetssequence", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.tcustpeoplerealassetsPK.assetssequence = :assetssequence"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByDatefrom", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.datefrom = :datefrom"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByRecordversion", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByLocation", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.location = :location"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByAssessment", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.assessment = :assessment"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByAssessmentdate", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.assessmentdate = :assessmentdate"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByMortgageamount", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.mortgageamount = :mortgageamount"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByMortgagedate", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.mortgagedate = :mortgagedate"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByMortgagebalance", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.mortgagebalance = :mortgagebalance"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByMortgagename", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.mortgagename = :mortgagename"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByRemark", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.remark = :remark"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByIngressusercode", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.ingressusercode = :ingressusercode"),
    @NamedQuery(name = "Tcustpeoplerealassets.findByModifyusercode", query = "SELECT t FROM Tcustpeoplerealassets t WHERE t.modifyusercode = :modifyusercode")})
public class Tcustpeoplerealassets implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TcustpeoplerealassetsPK tcustpeoplerealassetsPK;
    @Column(name = "DATEFROM")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datefrom;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "LOCATION")
    private String location;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "ASSESSMENT")
    private BigDecimal assessment;
    @Column(name = "ASSESSMENTDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date assessmentdate;
    @Column(name = "MORTGAGEAMOUNT")
    private BigDecimal mortgageamount;
    @Column(name = "MORTGAGEDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date mortgagedate;
    @Column(name = "MORTGAGEBALANCE")
    private BigDecimal mortgagebalance;
    @Column(name = "MORTGAGENAME")
    private String mortgagename;
    @Column(name = "REMARK")
    private String remark;
    @Column(name = "INGRESSUSERCODE")
    private String ingressusercode;
    @Column(name = "MODIFYUSERCODE")
    private String modifyusercode;
    @JoinColumn(name = "MORTGAGEPERSONCODE", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson mortgagepersoncode;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tcustperson tcustperson;
    @JoinColumns({
        @JoinColumn(name = "REALASSETSTYPECATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "REALASSETSTYPECATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "COUNTRYCODE", referencedColumnName = "COUNTRYCODE"),
        @JoinColumn(name = "PROVINCECODE", referencedColumnName = "PROVINCECODE"),
        @JoinColumn(name = "CANTONCODE", referencedColumnName = "CANTONCODE"),
        @JoinColumn(name = "CITYCODE", referencedColumnName = "CITYCODE")})
    @ManyToOne
    private Tgenecity tgenecity;
    @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE")
    @ManyToOne
    private Tgenecurrency currencycode;
    @JoinColumns({
        @JoinColumn(name = "COUNTRYCODE", referencedColumnName = "COUNTRYCODE"),
        @JoinColumn(name = "PROVINCECODE", referencedColumnName = "PROVINCECODE"),
        @JoinColumn(name = "CANTONCODE", referencedColumnName = "CANTONCODE"),
        @JoinColumn(name = "PARROQUIACODE", referencedColumnName = "PARROQUIACODE")})
    @ManyToOne
    private Tgeneparroquia tgeneparroquia;

    public Tcustpeoplerealassets() {
    }

    public Tcustpeoplerealassets(TcustpeoplerealassetsPK tcustpeoplerealassetsPK) {
        this.tcustpeoplerealassetsPK = tcustpeoplerealassetsPK;
    }

    public Tcustpeoplerealassets(long personcode, Date dateto, short assetssequence) {
        this.tcustpeoplerealassetsPK = new TcustpeoplerealassetsPK(personcode, dateto, assetssequence);
    }

    public TcustpeoplerealassetsPK getTcustpeoplerealassetsPK() {
        return tcustpeoplerealassetsPK;
    }

    public void setTcustpeoplerealassetsPK(TcustpeoplerealassetsPK tcustpeoplerealassetsPK) {
        this.tcustpeoplerealassetsPK = tcustpeoplerealassetsPK;
    }

    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 getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public BigDecimal getAssessment() {
        return assessment;
    }

    public void setAssessment(BigDecimal assessment) {
        this.assessment = assessment;
    }

    public Date getAssessmentdate() {
        return assessmentdate;
    }

    public void setAssessmentdate(Date assessmentdate) {
        this.assessmentdate = assessmentdate;
    }

    public BigDecimal getMortgageamount() {
        return mortgageamount;
    }

    public void setMortgageamount(BigDecimal mortgageamount) {
        this.mortgageamount = mortgageamount;
    }

    public Date getMortgagedate() {
        return mortgagedate;
    }

    public void setMortgagedate(Date mortgagedate) {
        this.mortgagedate = mortgagedate;
    }

    public BigDecimal getMortgagebalance() {
        return mortgagebalance;
    }

    public void setMortgagebalance(BigDecimal mortgagebalance) {
        this.mortgagebalance = mortgagebalance;
    }

    public String getMortgagename() {
        return mortgagename;
    }

    public void setMortgagename(String mortgagename) {
        this.mortgagename = mortgagename;
    }

    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 getMortgagepersoncode() {
        return mortgagepersoncode;
    }

    public void setMortgagepersoncode(Tcustperson mortgagepersoncode) {
        this.mortgagepersoncode = mortgagepersoncode;
    }

    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 Tgenecity getTgenecity() {
        return tgenecity;
    }

    public void setTgenecity(Tgenecity tgenecity) {
        this.tgenecity = tgenecity;
    }

    public Tgenecurrency getCurrencycode() {
        return currencycode;
    }

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

    public Tgeneparroquia getTgeneparroquia() {
        return tgeneparroquia;
    }

    public void setTgeneparroquia(Tgeneparroquia tgeneparroquia) {
        this.tgeneparroquia = tgeneparroquia;
    }

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

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