/*
 * 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 javax.persistence.Basic;
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.TGENESUBPRODUCTRATE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenesubproductrate.findAll", query = "SELECT t FROM Tgenesubproductrate t"),
    @NamedQuery(name = "Tgenesubproductrate.findByInterestbalancetype", query = "SELECT t FROM Tgenesubproductrate t WHERE t.tgenesubproductratePK.interestbalancetype = :interestbalancetype"),
    @NamedQuery(name = "Tgenesubproductrate.findByInterestbalancegroup", query = "SELECT t FROM Tgenesubproductrate t WHERE t.tgenesubproductratePK.interestbalancegroup = :interestbalancegroup"),
    @NamedQuery(name = "Tgenesubproductrate.findByModulecode", query = "SELECT t FROM Tgenesubproductrate t WHERE t.tgenesubproductratePK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgenesubproductrate.findByProductcode", query = "SELECT t FROM Tgenesubproductrate t WHERE t.tgenesubproductratePK.productcode = :productcode"),
    @NamedQuery(name = "Tgenesubproductrate.findBySubproductcode", query = "SELECT t FROM Tgenesubproductrate t WHERE t.tgenesubproductratePK.subproductcode = :subproductcode"),
    @NamedQuery(name = "Tgenesubproductrate.findByCompanycode", query = "SELECT t FROM Tgenesubproductrate t WHERE t.tgenesubproductratePK.companycode = :companycode"),
    @NamedQuery(name = "Tgenesubproductrate.findByCurrencycode", query = "SELECT t FROM Tgenesubproductrate t WHERE t.tgenesubproductratePK.currencycode = :currencycode"),
    @NamedQuery(name = "Tgenesubproductrate.findByRecordversion", query = "SELECT t FROM Tgenesubproductrate t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenesubproductrate.findByMargin", query = "SELECT t FROM Tgenesubproductrate t WHERE t.margin = :margin"),
    @NamedQuery(name = "Tgenesubproductrate.findByOperator", query = "SELECT t FROM Tgenesubproductrate t WHERE t.operator = :operator"),
    @NamedQuery(name = "Tgenesubproductrate.findByMinterm", query = "SELECT t FROM Tgenesubproductrate t WHERE t.minterm = :minterm"),
    @NamedQuery(name = "Tgenesubproductrate.findByMaxterm", query = "SELECT t FROM Tgenesubproductrate t WHERE t.maxterm = :maxterm"),
    @NamedQuery(name = "Tgenesubproductrate.findByMinamount", query = "SELECT t FROM Tgenesubproductrate t WHERE t.minamount = :minamount"),
    @NamedQuery(name = "Tgenesubproductrate.findByMaxamount", query = "SELECT t FROM Tgenesubproductrate t WHERE t.maxamount = :maxamount"),
    @NamedQuery(name = "Tgenesubproductrate.findByMinrate", query = "SELECT t FROM Tgenesubproductrate t WHERE t.minrate = :minrate"),
    @NamedQuery(name = "Tgenesubproductrate.findByMaxrate", query = "SELECT t FROM Tgenesubproductrate t WHERE t.maxrate = :maxrate"),
    @NamedQuery(name = "Tgenesubproductrate.findByReadjustmentoperator", query = "SELECT t FROM Tgenesubproductrate t WHERE t.readjustmentoperator = :readjustmentoperator"),
    @NamedQuery(name = "Tgenesubproductrate.findByReadjustmentmargin", query = "SELECT t FROM Tgenesubproductrate t WHERE t.readjustmentmargin = :readjustmentmargin"),
    @NamedQuery(name = "Tgenesubproductrate.findByRatesequence", query = "SELECT t FROM Tgenesubproductrate t WHERE t.tgenesubproductratePK.ratesequence = :ratesequence")})
public class Tgenesubproductrate implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenesubproductratePK tgenesubproductratePK;
    @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 = "MARGIN")
    private BigDecimal margin;
    @Column(name = "OPERATOR")
    private String operator;
    @Basic(optional = false)
    @Column(name = "MINTERM")
    private int minterm;
    @Column(name = "MAXTERM")
    private Integer maxterm;
    @Basic(optional = false)
    @Column(name = "MINAMOUNT")
    private BigDecimal minamount;
    @Column(name = "MAXAMOUNT")
    private BigDecimal maxamount;
    @Column(name = "MINRATE")
    private BigDecimal minrate;
    @Column(name = "MAXRATE")
    private BigDecimal maxrate;
    @Column(name = "READJUSTMENTOPERATOR")
    private String readjustmentoperator;
    @Column(name = "READJUSTMENTMARGIN")
    private BigDecimal readjustmentmargin;
    @JoinColumns({
        @JoinColumn(name = "INTERESTBALANCETYPE", referencedColumnName = "BALANCETYPE", insertable = false, updatable = false),
        @JoinColumn(name = "INTERESTBALANCEGROUP", referencedColumnName = "BALANCEGROUP", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenebalancetype tgenebalancetype;
    @JoinColumns({
        @JoinColumn(name = "MAXBASERATECATALOG", referencedColumnName = "BASERATECATALOG"),
        @JoinColumn(name = "MAXBASERATECATALOGCODE", referencedColumnName = "BASERATECATALOGCODE"),
        @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenebaserate tgenebaserate;
    @JoinColumns({
        @JoinColumn(name = "BASERATECATALOG", referencedColumnName = "BASERATECATALOG"),
        @JoinColumn(name = "BASERATECATALOGCODE", referencedColumnName = "BASERATECATALOGCODE"),
        @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenebaserate tgenebaserate1;
    @JoinColumns({
        @JoinColumn(name = "READJUSTBASERATECATALOG", referencedColumnName = "BASERATECATALOG"),
        @JoinColumn(name = "READJUSTBASERATECATALOGCODE", referencedColumnName = "BASERATECATALOGCODE"),
        @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenebaserate tgenebaserate2;
    @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenecompany tgenecompany;
    @JoinColumns({
        @JoinColumn(name = "MODULECODE", referencedColumnName = "MODULECODE", insertable = false, updatable = false),
        @JoinColumn(name = "PRODUCTCODE", referencedColumnName = "PRODUCTCODE", insertable = false, updatable = false),
        @JoinColumn(name = "SUBPRODUCTCODE", referencedColumnName = "SUBPRODUCTCODE", insertable = false, updatable = false),
        @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenesubproductcurrency tgenesubproductcurrency;

    public Tgenesubproductrate() {
    }

    public Tgenesubproductrate(TgenesubproductratePK tgenesubproductratePK) {
        this.tgenesubproductratePK = tgenesubproductratePK;
    }

    public Tgenesubproductrate(TgenesubproductratePK tgenesubproductratePK, int minterm, BigDecimal minamount) {
        this.tgenesubproductratePK = tgenesubproductratePK;
        this.minterm = minterm;
        this.minamount = minamount;
    }

    public Tgenesubproductrate(String interestbalancetype, String interestbalancegroup, String modulecode, String productcode, String subproductcode, long companycode, String currencycode, short ratesequence) {
        this.tgenesubproductratePK = new TgenesubproductratePK(interestbalancetype, interestbalancegroup, modulecode, productcode, subproductcode, companycode, currencycode, ratesequence);
    }

    public TgenesubproductratePK getTgenesubproductratePK() {
        return tgenesubproductratePK;
    }

    public void setTgenesubproductratePK(TgenesubproductratePK tgenesubproductratePK) {
        this.tgenesubproductratePK = tgenesubproductratePK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public BigDecimal getMargin() {
        return margin;
    }

    public void setMargin(BigDecimal margin) {
        this.margin = margin;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public int getMinterm() {
        return minterm;
    }

    public void setMinterm(int minterm) {
        this.minterm = minterm;
    }

    public Integer getMaxterm() {
        return maxterm;
    }

    public void setMaxterm(Integer maxterm) {
        this.maxterm = maxterm;
    }

    public BigDecimal getMinamount() {
        return minamount;
    }

    public void setMinamount(BigDecimal minamount) {
        this.minamount = minamount;
    }

    public BigDecimal getMaxamount() {
        return maxamount;
    }

    public void setMaxamount(BigDecimal maxamount) {
        this.maxamount = maxamount;
    }

    public BigDecimal getMinrate() {
        return minrate;
    }

    public void setMinrate(BigDecimal minrate) {
        this.minrate = minrate;
    }

    public BigDecimal getMaxrate() {
        return maxrate;
    }

    public void setMaxrate(BigDecimal maxrate) {
        this.maxrate = maxrate;
    }

    public String getReadjustmentoperator() {
        return readjustmentoperator;
    }

    public void setReadjustmentoperator(String readjustmentoperator) {
        this.readjustmentoperator = readjustmentoperator;
    }

    public BigDecimal getReadjustmentmargin() {
        return readjustmentmargin;
    }

    public void setReadjustmentmargin(BigDecimal readjustmentmargin) {
        this.readjustmentmargin = readjustmentmargin;
    }

    public Tgenebalancetype getTgenebalancetype() {
        return tgenebalancetype;
    }

    public void setTgenebalancetype(Tgenebalancetype tgenebalancetype) {
        this.tgenebalancetype = tgenebalancetype;
    }

    public Tgenebaserate getTgenebaserate() {
        return tgenebaserate;
    }

    public void setTgenebaserate(Tgenebaserate tgenebaserate) {
        this.tgenebaserate = tgenebaserate;
    }

    public Tgenebaserate getTgenebaserate1() {
        return tgenebaserate1;
    }

    public void setTgenebaserate1(Tgenebaserate tgenebaserate1) {
        this.tgenebaserate1 = tgenebaserate1;
    }

    public Tgenebaserate getTgenebaserate2() {
        return tgenebaserate2;
    }

    public void setTgenebaserate2(Tgenebaserate tgenebaserate2) {
        this.tgenebaserate2 = tgenebaserate2;
    }

    public Tgenecompany getTgenecompany() {
        return tgenecompany;
    }

    public void setTgenecompany(Tgenecompany tgenecompany) {
        this.tgenecompany = tgenecompany;
    }

    public Tgenesubproductcurrency getTgenesubproductcurrency() {
        return tgenesubproductcurrency;
    }

    public void setTgenesubproductcurrency(Tgenesubproductcurrency tgenesubproductcurrency) {
        this.tgenesubproductcurrency = tgenesubproductcurrency;
    }

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

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