/*
 * 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.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.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEBASERATEDETAIL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebaseratedetail.findAll", query = "SELECT t FROM Tgenebaseratedetail t"),
    @NamedQuery(name = "Tgenebaseratedetail.findByBaseratecatalog", query = "SELECT t FROM Tgenebaseratedetail t WHERE t.tgenebaseratedetailPK.baseratecatalog = :baseratecatalog"),
    @NamedQuery(name = "Tgenebaseratedetail.findByBaseratecatalogcode", query = "SELECT t FROM Tgenebaseratedetail t WHERE t.tgenebaseratedetailPK.baseratecatalogcode = :baseratecatalogcode"),
    @NamedQuery(name = "Tgenebaseratedetail.findByCurrencycode", query = "SELECT t FROM Tgenebaseratedetail t WHERE t.tgenebaseratedetailPK.currencycode = :currencycode"),
    @NamedQuery(name = "Tgenebaseratedetail.findByRatesequence", query = "SELECT t FROM Tgenebaseratedetail t WHERE t.tgenebaseratedetailPK.ratesequence = :ratesequence"),
    @NamedQuery(name = "Tgenebaseratedetail.findByRecordversion", query = "SELECT t FROM Tgenebaseratedetail t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenebaseratedetail.findByRate", query = "SELECT t FROM Tgenebaseratedetail t WHERE t.rate = :rate"),
    @NamedQuery(name = "Tgenebaseratedetail.findByNominalrate", query = "SELECT t FROM Tgenebaseratedetail t WHERE t.nominalrate = :nominalrate"),
    @NamedQuery(name = "Tgenebaseratedetail.findByValidityrate", query = "SELECT t FROM Tgenebaseratedetail t WHERE t.validityrate = :validityrate"),
    @NamedQuery(name = "Tgenebaseratedetail.findByExpirationdate", query = "SELECT t FROM Tgenebaseratedetail t WHERE t.expirationdate = :expirationdate")})
public class Tgenebaseratedetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebaseratedetailPK tgenebaseratedetailPK;
    @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 = "RATE")
    private BigDecimal rate;
    @Basic(optional = false)
    @Column(name = "NOMINALRATE")
    private String nominalrate;
    @Basic(optional = false)
    @Column(name = "VALIDITYRATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date validityrate;
    @Basic(optional = false)
    @Column(name = "EXPIRATIONDATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date expirationdate;
    @JoinColumns({
        @JoinColumn(name = "BASERATECATALOG", referencedColumnName = "BASERATECATALOG", insertable = false, updatable = false),
        @JoinColumn(name = "BASERATECATALOGCODE", referencedColumnName = "BASERATECATALOGCODE", insertable = false, updatable = false),
        @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Tgenebaserate tgenebaserate;

    public Tgenebaseratedetail() {
    }

    public Tgenebaseratedetail(TgenebaseratedetailPK tgenebaseratedetailPK) {
        this.tgenebaseratedetailPK = tgenebaseratedetailPK;
    }

    public Tgenebaseratedetail(TgenebaseratedetailPK tgenebaseratedetailPK, String nominalrate, Date validityrate, Date expirationdate) {
        this.tgenebaseratedetailPK = tgenebaseratedetailPK;
        this.nominalrate = nominalrate;
        this.validityrate = validityrate;
        this.expirationdate = expirationdate;
    }

    public Tgenebaseratedetail(String baseratecatalog, String baseratecatalogcode, String currencycode, int ratesequence) {
        this.tgenebaseratedetailPK = new TgenebaseratedetailPK(baseratecatalog, baseratecatalogcode, currencycode, ratesequence);
    }

    public TgenebaseratedetailPK getTgenebaseratedetailPK() {
        return tgenebaseratedetailPK;
    }

    public void setTgenebaseratedetailPK(TgenebaseratedetailPK tgenebaseratedetailPK) {
        this.tgenebaseratedetailPK = tgenebaseratedetailPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public BigDecimal getRate() {
        return rate;
    }

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

    public String getNominalrate() {
        return nominalrate;
    }

    public void setNominalrate(String nominalrate) {
        this.nominalrate = nominalrate;
    }

    public Date getValidityrate() {
        return validityrate;
    }

    public void setValidityrate(Date validityrate) {
        this.validityrate = validityrate;
    }

    public Date getExpirationdate() {
        return expirationdate;
    }

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

    public Tgenebaserate getTgenebaserate() {
        return tgenebaserate;
    }

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

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

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