/*
 * 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.BigInteger;
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.TBPMFLOWS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tbpmflows.findAll", query = "SELECT t FROM Tbpmflows t"),
    @NamedQuery(name = "Tbpmflows.findByFlowcode", query = "SELECT t FROM Tbpmflows t WHERE t.tbpmflowsPK.flowcode = :flowcode"),
    @NamedQuery(name = "Tbpmflows.findByCompanycode", query = "SELECT t FROM Tbpmflows t WHERE t.tbpmflowsPK.companycode = :companycode"),
    @NamedQuery(name = "Tbpmflows.findByDescription", query = "SELECT t FROM Tbpmflows t WHERE t.description = :description"),
    @NamedQuery(name = "Tbpmflows.findByRecordversion", query = "SELECT t FROM Tbpmflows t WHERE t.recordversion = :recordversion")})
public class Tbpmflows implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TbpmflowsPK tbpmflowsPK;
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @JoinColumn(name = "COMPANYCODE", referencedColumnName = "COMPANYCODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenecompany tgenecompany;

    public Tbpmflows() {
    }

    public Tbpmflows(TbpmflowsPK tbpmflowsPK) {
        this.tbpmflowsPK = tbpmflowsPK;
    }

    public Tbpmflows(String flowcode, long companycode) {
        this.tbpmflowsPK = new TbpmflowsPK(flowcode, companycode);
    }

    public TbpmflowsPK getTbpmflowsPK() {
        return tbpmflowsPK;
    }

    public void setTbpmflowsPK(TbpmflowsPK tbpmflowsPK) {
        this.tbpmflowsPK = tbpmflowsPK;
    }

    public String getDescription() {
        return description;
    }

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

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Tgenecompany getTgenecompany() {
        return tgenecompany;
    }

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

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

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