/*
 * 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.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.TSAFEPROFILEHORARYAMOUNT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tsafeprofilehoraryamount.findAll", query = "SELECT t FROM Tsafeprofilehoraryamount t"),
    @NamedQuery(name = "Tsafeprofilehoraryamount.findByRegistercode", query = "SELECT t FROM Tsafeprofilehoraryamount t WHERE t.tsafeprofilehoraryamountPK.registercode = :registercode"),
    @NamedQuery(name = "Tsafeprofilehoraryamount.findByModulecode", query = "SELECT t FROM Tsafeprofilehoraryamount t WHERE t.tsafeprofilehoraryamountPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tsafeprofilehoraryamount.findByProductcode", query = "SELECT t FROM Tsafeprofilehoraryamount t WHERE t.tsafeprofilehoraryamountPK.productcode = :productcode"),
    @NamedQuery(name = "Tsafeprofilehoraryamount.findBySubproductcode", query = "SELECT t FROM Tsafeprofilehoraryamount t WHERE t.tsafeprofilehoraryamountPK.subproductcode = :subproductcode"),
    @NamedQuery(name = "Tsafeprofilehoraryamount.findByCurrencycode", query = "SELECT t FROM Tsafeprofilehoraryamount t WHERE t.tsafeprofilehoraryamountPK.currencycode = :currencycode"),
    @NamedQuery(name = "Tsafeprofilehoraryamount.findByRecordversion", query = "SELECT t FROM Tsafeprofilehoraryamount t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tsafeprofilehoraryamount.findByAmount", query = "SELECT t FROM Tsafeprofilehoraryamount t WHERE t.amount = :amount")})
public class Tsafeprofilehoraryamount implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TsafeprofilehoraryamountPK tsafeprofilehoraryamountPK;
    @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;
    @JoinColumn(name = "CURRENCYCODE", referencedColumnName = "CURRENCYCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenecurrency tgenecurrency;
    @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)})
    @ManyToOne(optional = false)
    private Tgenesubproduct tgenesubproduct;

    public Tsafeprofilehoraryamount() {
    }

    public Tsafeprofilehoraryamount(TsafeprofilehoraryamountPK tsafeprofilehoraryamountPK) {
        this.tsafeprofilehoraryamountPK = tsafeprofilehoraryamountPK;
    }

    public Tsafeprofilehoraryamount(String registercode, String modulecode, String productcode, String subproductcode, String currencycode) {
        this.tsafeprofilehoraryamountPK = new TsafeprofilehoraryamountPK(registercode, modulecode, productcode, subproductcode, currencycode);
    }

    public TsafeprofilehoraryamountPK getTsafeprofilehoraryamountPK() {
        return tsafeprofilehoraryamountPK;
    }

    public void setTsafeprofilehoraryamountPK(TsafeprofilehoraryamountPK tsafeprofilehoraryamountPK) {
        this.tsafeprofilehoraryamountPK = tsafeprofilehoraryamountPK;
    }

    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 Tgenecurrency getTgenecurrency() {
        return tgenecurrency;
    }

    public void setTgenecurrency(Tgenecurrency tgenecurrency) {
        this.tgenecurrency = tgenecurrency;
    }

    public Tgenesubproduct getTgenesubproduct() {
        return tgenesubproduct;
    }

    public void setTgenesubproduct(Tgenesubproduct tgenesubproduct) {
        this.tgenesubproduct = tgenesubproduct;
    }

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

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