/*
 * 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 java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TBPMFIELD")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tbpmfield.findAll", query = "SELECT t FROM Tbpmfield t"),
    @NamedQuery(name = "Tbpmfield.findByFieldname", query = "SELECT t FROM Tbpmfield t WHERE t.fieldname = :fieldname"),
    @NamedQuery(name = "Tbpmfield.findByRecordversion", query = "SELECT t FROM Tbpmfield t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tbpmfield.findByDescription", query = "SELECT t FROM Tbpmfield t WHERE t.description = :description")})
public class Tbpmfield implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "FIELDNAME")
    private String fieldname;
    @Basic(optional = false)
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tbpmfield")
    private Collection<Tbpmfieldtransactionorigin> tbpmfieldtransactionoriginCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tbpmfield")
    private Collection<Tbpmfieldtransactionmaping> tbpmfieldtransactionmapingCollection;

    public Tbpmfield() {
    }

    public Tbpmfield(String fieldname) {
        this.fieldname = fieldname;
    }

    public Tbpmfield(String fieldname, BigInteger recordversion) {
        this.fieldname = fieldname;
        this.recordversion = recordversion;
    }

    public String getFieldname() {
        return fieldname;
    }

    public void setFieldname(String fieldname) {
        this.fieldname = fieldname;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getDescription() {
        return description;
    }

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

    @XmlTransient
    public Collection<Tbpmfieldtransactionorigin> getTbpmfieldtransactionoriginCollection() {
        return tbpmfieldtransactionoriginCollection;
    }

    public void setTbpmfieldtransactionoriginCollection(Collection<Tbpmfieldtransactionorigin> tbpmfieldtransactionoriginCollection) {
        this.tbpmfieldtransactionoriginCollection = tbpmfieldtransactionoriginCollection;
    }

    @XmlTransient
    public Collection<Tbpmfieldtransactionmaping> getTbpmfieldtransactionmapingCollection() {
        return tbpmfieldtransactionmapingCollection;
    }

    public void setTbpmfieldtransactionmapingCollection(Collection<Tbpmfieldtransactionmaping> tbpmfieldtransactionmapingCollection) {
        this.tbpmfieldtransactionmapingCollection = tbpmfieldtransactionmapingCollection;
    }

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

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