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

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TARMDOCUMENTOHABILITANTE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmdocumentohabilitante.findAll", query = "SELECT t FROM Tarmdocumentohabilitante t"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByCdocumento", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.cdocumento = :cdocumento"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByNumerodocumento", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.numerodocumento = :numerodocumento"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByFechaemision", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.fechaemision = :fechaemision"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByFechaexpiracion", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.fechaexpiracion = :fechaexpiracion"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByCsolicitud", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.csolicitud = :csolicitud"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByXpath", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.xpath = :xpath"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByCodigoarma", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.codigoarma = :codigoarma"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByCuentareimpresion", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.cuentareimpresion = :cuentareimpresion"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByCcentrocontrol", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.ccentrocontrol = :ccentrocontrol"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByObservacion", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.observacion = :observacion"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByFechacambioexpiracion", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.fechacambioexpiracion = :fechacambioexpiracion"),
    @NamedQuery(name = "Tarmdocumentohabilitante.findByPathsuspencion", query = "SELECT t FROM Tarmdocumentohabilitante t WHERE t.pathsuspencion = :pathsuspencion")})
public class Tarmdocumentohabilitante implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CDOCUMENTO")
    private Long cdocumento;
    @Column(name = "NUMERODOCUMENTO")
    private String numerodocumento;
    @Column(name = "FECHAEMISION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaemision;
    @Column(name = "FECHAEXPIRACION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaexpiracion;
    @Column(name = "CSOLICITUD")
    private String csolicitud;
    @Column(name = "XPATH")
    private String xpath;
    @Column(name = "CODIGOARMA")
    private String codigoarma;
    @Column(name = "CUENTAREIMPRESION")
    private Short cuentareimpresion;
    @Column(name = "CCENTROCONTROL")
    private String ccentrocontrol;
    @Column(name = "OBSERVACION")
    private String observacion;
    @Column(name = "FECHACAMBIOEXPIRACION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechacambioexpiracion;
    @Column(name = "PATHSUSPENCION")
    private String pathsuspencion;
    @OneToMany(mappedBy = "cdocumento")
    private Collection<Tarmplanificaciontramite> tarmplanificaciontramiteCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tarmdocumentohabilitante")
    private Collection<Tarmsolicituddocumento> tarmsolicituddocumentoCollection;
    @JoinColumn(name = "CARMA", referencedColumnName = "CARMA")
    @ManyToOne
    private Tarmarmas carma;
    @JoinColumn(name = "CTRAMITE", referencedColumnName = "CTRAMITE")
    @ManyToOne
    private Tarmtramite ctramite;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson personcode;
    @JoinColumns({
        @JoinColumn(name = "ESTADO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "ESTADOCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @OneToMany(mappedBy = "cdocumento")
    private Collection<Tarmdocumentohabilitantedetall> tarmdocumentohabilitantedetallCollection;
    @OneToMany(mappedBy = "cdocumento")
    private Collection<Tarmcoladeimpresion> tarmcoladeimpresionCollection;

    public Tarmdocumentohabilitante() {
    }

    public Tarmdocumentohabilitante(Long cdocumento) {
        this.cdocumento = cdocumento;
    }

    public Long getCdocumento() {
        return cdocumento;
    }

    public void setCdocumento(Long cdocumento) {
        this.cdocumento = cdocumento;
    }

    public String getNumerodocumento() {
        return numerodocumento;
    }

    public void setNumerodocumento(String numerodocumento) {
        this.numerodocumento = numerodocumento;
    }

    public Date getFechaemision() {
        return fechaemision;
    }

    public void setFechaemision(Date fechaemision) {
        this.fechaemision = fechaemision;
    }

    public Date getFechaexpiracion() {
        return fechaexpiracion;
    }

    public void setFechaexpiracion(Date fechaexpiracion) {
        this.fechaexpiracion = fechaexpiracion;
    }

    public String getCsolicitud() {
        return csolicitud;
    }

    public void setCsolicitud(String csolicitud) {
        this.csolicitud = csolicitud;
    }

    public String getXpath() {
        return xpath;
    }

    public void setXpath(String xpath) {
        this.xpath = xpath;
    }

    public String getCodigoarma() {
        return codigoarma;
    }

    public void setCodigoarma(String codigoarma) {
        this.codigoarma = codigoarma;
    }

    public Short getCuentareimpresion() {
        return cuentareimpresion;
    }

    public void setCuentareimpresion(Short cuentareimpresion) {
        this.cuentareimpresion = cuentareimpresion;
    }

    public String getCcentrocontrol() {
        return ccentrocontrol;
    }

    public void setCcentrocontrol(String ccentrocontrol) {
        this.ccentrocontrol = ccentrocontrol;
    }

    public String getObservacion() {
        return observacion;
    }

    public void setObservacion(String observacion) {
        this.observacion = observacion;
    }

    public Date getFechacambioexpiracion() {
        return fechacambioexpiracion;
    }

    public void setFechacambioexpiracion(Date fechacambioexpiracion) {
        this.fechacambioexpiracion = fechacambioexpiracion;
    }

    public String getPathsuspencion() {
        return pathsuspencion;
    }

    public void setPathsuspencion(String pathsuspencion) {
        this.pathsuspencion = pathsuspencion;
    }

    @XmlTransient
    public Collection<Tarmplanificaciontramite> getTarmplanificaciontramiteCollection() {
        return tarmplanificaciontramiteCollection;
    }

    public void setTarmplanificaciontramiteCollection(Collection<Tarmplanificaciontramite> tarmplanificaciontramiteCollection) {
        this.tarmplanificaciontramiteCollection = tarmplanificaciontramiteCollection;
    }

    @XmlTransient
    public Collection<Tarmsolicituddocumento> getTarmsolicituddocumentoCollection() {
        return tarmsolicituddocumentoCollection;
    }

    public void setTarmsolicituddocumentoCollection(Collection<Tarmsolicituddocumento> tarmsolicituddocumentoCollection) {
        this.tarmsolicituddocumentoCollection = tarmsolicituddocumentoCollection;
    }

    public Tarmarmas getCarma() {
        return carma;
    }

    public void setCarma(Tarmarmas carma) {
        this.carma = carma;
    }

    public Tarmtramite getCtramite() {
        return ctramite;
    }

    public void setCtramite(Tarmtramite ctramite) {
        this.ctramite = ctramite;
    }

    public Tcustperson getPersoncode() {
        return personcode;
    }

    public void setPersoncode(Tcustperson personcode) {
        this.personcode = personcode;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

    @XmlTransient
    public Collection<Tarmdocumentohabilitantedetall> getTarmdocumentohabilitantedetallCollection() {
        return tarmdocumentohabilitantedetallCollection;
    }

    public void setTarmdocumentohabilitantedetallCollection(Collection<Tarmdocumentohabilitantedetall> tarmdocumentohabilitantedetallCollection) {
        this.tarmdocumentohabilitantedetallCollection = tarmdocumentohabilitantedetallCollection;
    }

    @XmlTransient
    public Collection<Tarmcoladeimpresion> getTarmcoladeimpresionCollection() {
        return tarmcoladeimpresionCollection;
    }

    public void setTarmcoladeimpresionCollection(Collection<Tarmcoladeimpresion> tarmcoladeimpresionCollection) {
        this.tarmcoladeimpresionCollection = tarmcoladeimpresionCollection;
    }

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

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