/*
 * 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.TARMREQUISITO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmrequisito.findAll", query = "SELECT t FROM Tarmrequisito t"),
    @NamedQuery(name = "Tarmrequisito.findByCrequisito", query = "SELECT t FROM Tarmrequisito t WHERE t.crequisito = :crequisito"),
    @NamedQuery(name = "Tarmrequisito.findByNombre", query = "SELECT t FROM Tarmrequisito t WHERE t.nombre = :nombre"),
    @NamedQuery(name = "Tarmrequisito.findByRecordversion", query = "SELECT t FROM Tarmrequisito t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tarmrequisito.findByDescripcioncorta", query = "SELECT t FROM Tarmrequisito t WHERE t.descripcioncorta = :descripcioncorta"),
    @NamedQuery(name = "Tarmrequisito.findByActive", query = "SELECT t FROM Tarmrequisito t WHERE t.active = :active")})
public class Tarmrequisito implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CREQUISITO")
    private String crequisito;
    @Basic(optional = false)
    @Column(name = "NOMBRE")
    private String nombre;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPCIONCORTA")
    private String descripcioncorta;
    @Column(name = "ACTIVE")
    private String active;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tarmrequisito")
    private Collection<Tarmrequisitoportipotramite> tarmrequisitoportipotramiteCollection;

    public Tarmrequisito() {
    }

    public Tarmrequisito(String crequisito) {
        this.crequisito = crequisito;
    }

    public Tarmrequisito(String crequisito, String nombre) {
        this.crequisito = crequisito;
        this.nombre = nombre;
    }

    public String getCrequisito() {
        return crequisito;
    }

    public void setCrequisito(String crequisito) {
        this.crequisito = crequisito;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getDescripcioncorta() {
        return descripcioncorta;
    }

    public void setDescripcioncorta(String descripcioncorta) {
        this.descripcioncorta = descripcioncorta;
    }

    public String getActive() {
        return active;
    }

    public void setActive(String active) {
        this.active = active;
    }

    @XmlTransient
    public Collection<Tarmrequisitoportipotramite> getTarmrequisitoportipotramiteCollection() {
        return tarmrequisitoportipotramiteCollection;
    }

    public void setTarmrequisitoportipotramiteCollection(Collection<Tarmrequisitoportipotramite> tarmrequisitoportipotramiteCollection) {
        this.tarmrequisitoportipotramiteCollection = tarmrequisitoportipotramiteCollection;
    }

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

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