/*
 * 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 javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
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.TGENEPARAMETERS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneparameters.findAll", query = "SELECT t FROM Tgeneparameters t"),
    @NamedQuery(name = "Tgeneparameters.findByCode", query = "SELECT t FROM Tgeneparameters t WHERE t.tgeneparametersPK.code = :code"),
    @NamedQuery(name = "Tgeneparameters.findByCompanycode", query = "SELECT t FROM Tgeneparameters t WHERE t.tgeneparametersPK.companycode = :companycode"),
    @NamedQuery(name = "Tgeneparameters.findByTextvalue", query = "SELECT t FROM Tgeneparameters t WHERE t.textvalue = :textvalue"),
    @NamedQuery(name = "Tgeneparameters.findByNumbervalue", query = "SELECT t FROM Tgeneparameters t WHERE t.numbervalue = :numbervalue"),
    @NamedQuery(name = "Tgeneparameters.findByDescription", query = "SELECT t FROM Tgeneparameters t WHERE t.description = :description")})
public class Tgeneparameters implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneparametersPK tgeneparametersPK;
    @Column(name = "TEXTVALUE")
    private String textvalue;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "NUMBERVALUE")
    private BigDecimal numbervalue;
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenecompany tgenecompany;

    public Tgeneparameters() {
    }

    public Tgeneparameters(TgeneparametersPK tgeneparametersPK) {
        this.tgeneparametersPK = tgeneparametersPK;
    }

    public Tgeneparameters(String code, long companycode) {
        this.tgeneparametersPK = new TgeneparametersPK(code, companycode);
    }

    public TgeneparametersPK getTgeneparametersPK() {
        return tgeneparametersPK;
    }

    public void setTgeneparametersPK(TgeneparametersPK tgeneparametersPK) {
        this.tgeneparametersPK = tgeneparametersPK;
    }

    public String getTextvalue() {
        return textvalue;
    }

    public void setTextvalue(String textvalue) {
        this.textvalue = textvalue;
    }

    public BigDecimal getNumbervalue() {
        return numbervalue;
    }

    public void setNumbervalue(BigDecimal numbervalue) {
        this.numbervalue = numbervalue;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Tgenecompany getTgenecompany() {
        return tgenecompany;
    }

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

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

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