/*
 * 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 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.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
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.TARMTRAMITE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmtramite.findAll", query = "SELECT t FROM Tarmtramite t"),
    @NamedQuery(name = "Tarmtramite.findByCtramite", query = "SELECT t FROM Tarmtramite t WHERE t.ctramite = :ctramite"),
    @NamedQuery(name = "Tarmtramite.findByCosto", query = "SELECT t FROM Tarmtramite t WHERE t.costo = :costo"),
    @NamedQuery(name = "Tarmtramite.findByRegistroguardia", query = "SELECT t FROM Tarmtramite t WHERE t.registroguardia = :registroguardia"),
    @NamedQuery(name = "Tarmtramite.findByRegistroarmas", query = "SELECT t FROM Tarmtramite t WHERE t.registroarmas = :registroarmas"),
    @NamedQuery(name = "Tarmtramite.findByRegistroagenciasucursal", query = "SELECT t FROM Tarmtramite t WHERE t.registroagenciasucursal = :registroagenciasucursal"),
    @NamedQuery(name = "Tarmtramite.findByRequiereevaluacion", query = "SELECT t FROM Tarmtramite t WHERE t.requiereevaluacion = :requiereevaluacion"),
    @NamedQuery(name = "Tarmtramite.findByRequiereinspeccion", query = "SELECT t FROM Tarmtramite t WHERE t.requiereinspeccion = :requiereinspeccion"),
    @NamedQuery(name = "Tarmtramite.findByDocumentohabilitante", query = "SELECT t FROM Tarmtramite t WHERE t.documentohabilitante = :documentohabilitante"),
    @NamedQuery(name = "Tarmtramite.findByRecordversion", query = "SELECT t FROM Tarmtramite t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tarmtramite.findByCabecera", query = "SELECT t FROM Tarmtramite t WHERE t.cabecera = :cabecera"),
    @NamedQuery(name = "Tarmtramite.findByPie", query = "SELECT t FROM Tarmtramite t WHERE t.pie = :pie"),
    @NamedQuery(name = "Tarmtramite.findByCostocustodio", query = "SELECT t FROM Tarmtramite t WHERE t.costocustodio = :costocustodio"),
    @NamedQuery(name = "Tarmtramite.findByMulta", query = "SELECT t FROM Tarmtramite t WHERE t.multa = :multa"),
    @NamedQuery(name = "Tarmtramite.findByReimpresion", query = "SELECT t FROM Tarmtramite t WHERE t.reimpresion = :reimpresion"),
    @NamedQuery(name = "Tarmtramite.findByNumeromaxarmas", query = "SELECT t FROM Tarmtramite t WHERE t.numeromaxarmas = :numeromaxarmas"),
    @NamedQuery(name = "Tarmtramite.findByEstados", query = "SELECT t FROM Tarmtramite t WHERE t.estados = :estados"),
    @NamedQuery(name = "Tarmtramite.findByLogo", query = "SELECT t FROM Tarmtramite t WHERE t.logo = :logo"),
    @NamedQuery(name = "Tarmtramite.findByTipopersona", query = "SELECT t FROM Tarmtramite t WHERE t.tipopersona = :tipopersona"),
    @NamedQuery(name = "Tarmtramite.findByTipopersonacode", query = "SELECT t FROM Tarmtramite t WHERE t.tipopersonacode = :tipopersonacode"),
    @NamedQuery(name = "Tarmtramite.findBySancionable", query = "SELECT t FROM Tarmtramite t WHERE t.sancionable = :sancionable"),
    @NamedQuery(name = "Tarmtramite.findByEstadofinarma", query = "SELECT t FROM Tarmtramite t WHERE t.estadofinarma = :estadofinarma"),
    @NamedQuery(name = "Tarmtramite.findByClase", query = "SELECT t FROM Tarmtramite t WHERE t.clase = :clase"),
    @NamedQuery(name = "Tarmtramite.findByCtramitepadrealt", query = "SELECT t FROM Tarmtramite t WHERE t.ctramitepadrealt = :ctramitepadrealt"),
    @NamedQuery(name = "Tarmtramite.findByValidacaducidadpadre", query = "SELECT t FROM Tarmtramite t WHERE t.validacaducidadpadre = :validacaducidadpadre"),
    @NamedQuery(name = "Tarmtramite.findByValidacaducidadpadrealt", query = "SELECT t FROM Tarmtramite t WHERE t.validacaducidadpadrealt = :validacaducidadpadrealt"),
    @NamedQuery(name = "Tarmtramite.findByValidafechaexpiracion", query = "SELECT t FROM Tarmtramite t WHERE t.validafechaexpiracion = :validafechaexpiracion"),
    @NamedQuery(name = "Tarmtramite.findByVisualizarporfechaexpiracion", query = "SELECT t FROM Tarmtramite t WHERE t.visualizarporfechaexpiracion = :visualizarporfechaexpiracion"),
    @NamedQuery(name = "Tarmtramite.findByJurisdiccion", query = "SELECT t FROM Tarmtramite t WHERE t.jurisdiccion = :jurisdiccion"),
    @NamedQuery(name = "Tarmtramite.findByJurisdiccioncode", query = "SELECT t FROM Tarmtramite t WHERE t.jurisdiccioncode = :jurisdiccioncode"),
    @NamedQuery(name = "Tarmtramite.findByTipofabricacion", query = "SELECT t FROM Tarmtramite t WHERE t.tipofabricacion = :tipofabricacion")})
public class Tarmtramite implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CTRAMITE")
    private Long ctramite;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "COSTO")
    private BigDecimal costo;
    @Column(name = "REGISTROGUARDIA")
    private String registroguardia;
    @Column(name = "REGISTROARMAS")
    private String registroarmas;
    @Column(name = "REGISTROAGENCIASUCURSAL")
    private String registroagenciasucursal;
    @Column(name = "REQUIEREEVALUACION")
    private String requiereevaluacion;
    @Column(name = "REQUIEREINSPECCION")
    private String requiereinspeccion;
    @Column(name = "DOCUMENTOHABILITANTE")
    private String documentohabilitante;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "CABECERA")
    private String cabecera;
    @Column(name = "PIE")
    private String pie;
    @Column(name = "COSTOCUSTODIO")
    private BigDecimal costocustodio;
    @Column(name = "MULTA")
    private BigDecimal multa;
    @Column(name = "REIMPRESION")
    private String reimpresion;
    @Column(name = "NUMEROMAXARMAS")
    private BigInteger numeromaxarmas;
    @Column(name = "ESTADOS")
    private String estados;
    @Column(name = "LOGO")
    private String logo;
    @Column(name = "TIPOPERSONA")
    private String tipopersona;
    @Column(name = "TIPOPERSONACODE")
    private String tipopersonacode;
    @Column(name = "SANCIONABLE")
    private String sancionable;
    @Column(name = "ESTADOFINARMA")
    private String estadofinarma;
    @Column(name = "CLASE")
    private String clase;
    @Column(name = "CTRAMITEPADREALT")
    private Long ctramitepadrealt;
    @Column(name = "VALIDACADUCIDADPADRE")
    private String validacaducidadpadre;
    @Column(name = "VALIDACADUCIDADPADREALT")
    private String validacaducidadpadrealt;
    @Column(name = "VALIDAFECHAEXPIRACION")
    private String validafechaexpiracion;
    @Column(name = "VISUALIZARPORFECHAEXPIRACION")
    private String visualizarporfechaexpiracion;
    @Column(name = "JURISDICCION")
    private String jurisdiccion;
    @Column(name = "JURISDICCIONCODE")
    private String jurisdiccioncode;
    @Column(name = "TIPOFABRICACION")
    private String tipofabricacion;
    @JoinTable(name = "TARMORIGENTRAMITE", joinColumns = {
        @JoinColumn(name = "CTRAMITE", referencedColumnName = "CTRAMITE")}, inverseJoinColumns = {
        @JoinColumn(name = "ORIGENCATALOG", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "ORIGENCATALOGCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToMany
    private Collection<Tgenecatalogdetail> tgenecatalogdetailCollection;
    @OneToMany(mappedBy = "ctramite")
    private Collection<Tarmplanificaciontramite> tarmplanificaciontramiteCollection;
    @OneToMany(mappedBy = "ctramite")
    private Collection<Tarmdocumentohabilitante> tarmdocumentohabilitanteCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ctramite")
    private Collection<Tarmtramitesatendidos> tarmtramitesatendidosCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tarmtramite")
    private Collection<Tarmrequisitoportipotramite> tarmrequisitoportipotramiteCollection;
    @OneToMany(mappedBy = "ctramitepadre")
    private Collection<Tarmtramite> tarmtramiteCollection;
    @JoinColumn(name = "CTRAMITEPADRE", referencedColumnName = "CTRAMITE")
    @ManyToOne
    private Tarmtramite ctramitepadre;
    @JoinColumns({
        @JoinColumn(name = "USOACTIVIDAD", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "USOACTIVIDADCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "TIPOARCHIVO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPOARCHIVOCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "FLUJOTRAMITE", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "FLUJOTRAMITECODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail2;
    @JoinColumns({
        @JoinColumn(name = "TIPOAUTORIZACION", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPOAUTORIZACIONCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail3;
    @JoinColumns({
        @JoinColumn(name = "VIGENCIA", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "VIGENCIACODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail4;
    @JoinColumns({
        @JoinColumn(name = "TIPOCOSTO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPOCOSTOCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail5;
    @JoinColumns({
        @JoinColumn(name = "TIPOTRAMITE", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPOTRAMITECODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail6;
    @JoinColumns({
        @JoinColumn(name = "CATEGORIA", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "CATEGORIACODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne(optional = false)
    private Tgenecatalogdetail tgenecatalogdetail7;
    @OneToMany(mappedBy = "ctramite")
    private Collection<Tarmsolicitud> tarmsolicitudCollection;

    public Tarmtramite() {
    }

    public Tarmtramite(Long ctramite) {
        this.ctramite = ctramite;
    }

    public Long getCtramite() {
        return ctramite;
    }

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

    public BigDecimal getCosto() {
        return costo;
    }

    public void setCosto(BigDecimal costo) {
        this.costo = costo;
    }

    public String getRegistroguardia() {
        return registroguardia;
    }

    public void setRegistroguardia(String registroguardia) {
        this.registroguardia = registroguardia;
    }

    public String getRegistroarmas() {
        return registroarmas;
    }

    public void setRegistroarmas(String registroarmas) {
        this.registroarmas = registroarmas;
    }

    public String getRegistroagenciasucursal() {
        return registroagenciasucursal;
    }

    public void setRegistroagenciasucursal(String registroagenciasucursal) {
        this.registroagenciasucursal = registroagenciasucursal;
    }

    public String getRequiereevaluacion() {
        return requiereevaluacion;
    }

    public void setRequiereevaluacion(String requiereevaluacion) {
        this.requiereevaluacion = requiereevaluacion;
    }

    public String getRequiereinspeccion() {
        return requiereinspeccion;
    }

    public void setRequiereinspeccion(String requiereinspeccion) {
        this.requiereinspeccion = requiereinspeccion;
    }

    public String getDocumentohabilitante() {
        return documentohabilitante;
    }

    public void setDocumentohabilitante(String documentohabilitante) {
        this.documentohabilitante = documentohabilitante;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getCabecera() {
        return cabecera;
    }

    public void setCabecera(String cabecera) {
        this.cabecera = cabecera;
    }

    public String getPie() {
        return pie;
    }

    public void setPie(String pie) {
        this.pie = pie;
    }

    public BigDecimal getCostocustodio() {
        return costocustodio;
    }

    public void setCostocustodio(BigDecimal costocustodio) {
        this.costocustodio = costocustodio;
    }

    public BigDecimal getMulta() {
        return multa;
    }

    public void setMulta(BigDecimal multa) {
        this.multa = multa;
    }

    public String getReimpresion() {
        return reimpresion;
    }

    public void setReimpresion(String reimpresion) {
        this.reimpresion = reimpresion;
    }

    public BigInteger getNumeromaxarmas() {
        return numeromaxarmas;
    }

    public void setNumeromaxarmas(BigInteger numeromaxarmas) {
        this.numeromaxarmas = numeromaxarmas;
    }

    public String getEstados() {
        return estados;
    }

    public void setEstados(String estados) {
        this.estados = estados;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public String getTipopersona() {
        return tipopersona;
    }

    public void setTipopersona(String tipopersona) {
        this.tipopersona = tipopersona;
    }

    public String getTipopersonacode() {
        return tipopersonacode;
    }

    public void setTipopersonacode(String tipopersonacode) {
        this.tipopersonacode = tipopersonacode;
    }

    public String getSancionable() {
        return sancionable;
    }

    public void setSancionable(String sancionable) {
        this.sancionable = sancionable;
    }

    public String getEstadofinarma() {
        return estadofinarma;
    }

    public void setEstadofinarma(String estadofinarma) {
        this.estadofinarma = estadofinarma;
    }

    public String getClase() {
        return clase;
    }

    public void setClase(String clase) {
        this.clase = clase;
    }

    public Long getCtramitepadrealt() {
        return ctramitepadrealt;
    }

    public void setCtramitepadrealt(Long ctramitepadrealt) {
        this.ctramitepadrealt = ctramitepadrealt;
    }

    public String getValidacaducidadpadre() {
        return validacaducidadpadre;
    }

    public void setValidacaducidadpadre(String validacaducidadpadre) {
        this.validacaducidadpadre = validacaducidadpadre;
    }

    public String getValidacaducidadpadrealt() {
        return validacaducidadpadrealt;
    }

    public void setValidacaducidadpadrealt(String validacaducidadpadrealt) {
        this.validacaducidadpadrealt = validacaducidadpadrealt;
    }

    public String getValidafechaexpiracion() {
        return validafechaexpiracion;
    }

    public void setValidafechaexpiracion(String validafechaexpiracion) {
        this.validafechaexpiracion = validafechaexpiracion;
    }

    public String getVisualizarporfechaexpiracion() {
        return visualizarporfechaexpiracion;
    }

    public void setVisualizarporfechaexpiracion(String visualizarporfechaexpiracion) {
        this.visualizarporfechaexpiracion = visualizarporfechaexpiracion;
    }

    public String getJurisdiccion() {
        return jurisdiccion;
    }

    public void setJurisdiccion(String jurisdiccion) {
        this.jurisdiccion = jurisdiccion;
    }

    public String getJurisdiccioncode() {
        return jurisdiccioncode;
    }

    public void setJurisdiccioncode(String jurisdiccioncode) {
        this.jurisdiccioncode = jurisdiccioncode;
    }

    public String getTipofabricacion() {
        return tipofabricacion;
    }

    public void setTipofabricacion(String tipofabricacion) {
        this.tipofabricacion = tipofabricacion;
    }

    @XmlTransient
    public Collection<Tgenecatalogdetail> getTgenecatalogdetailCollection() {
        return tgenecatalogdetailCollection;
    }

    public void setTgenecatalogdetailCollection(Collection<Tgenecatalogdetail> tgenecatalogdetailCollection) {
        this.tgenecatalogdetailCollection = tgenecatalogdetailCollection;
    }

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

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

    @XmlTransient
    public Collection<Tarmdocumentohabilitante> getTarmdocumentohabilitanteCollection() {
        return tarmdocumentohabilitanteCollection;
    }

    public void setTarmdocumentohabilitanteCollection(Collection<Tarmdocumentohabilitante> tarmdocumentohabilitanteCollection) {
        this.tarmdocumentohabilitanteCollection = tarmdocumentohabilitanteCollection;
    }

    @XmlTransient
    public Collection<Tarmtramitesatendidos> getTarmtramitesatendidosCollection() {
        return tarmtramitesatendidosCollection;
    }

    public void setTarmtramitesatendidosCollection(Collection<Tarmtramitesatendidos> tarmtramitesatendidosCollection) {
        this.tarmtramitesatendidosCollection = tarmtramitesatendidosCollection;
    }

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

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

    @XmlTransient
    public Collection<Tarmtramite> getTarmtramiteCollection() {
        return tarmtramiteCollection;
    }

    public void setTarmtramiteCollection(Collection<Tarmtramite> tarmtramiteCollection) {
        this.tarmtramiteCollection = tarmtramiteCollection;
    }

    public Tarmtramite getCtramitepadre() {
        return ctramitepadre;
    }

    public void setCtramitepadre(Tarmtramite ctramitepadre) {
        this.ctramitepadre = ctramitepadre;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

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

    public Tgenecatalogdetail getTgenecatalogdetail1() {
        return tgenecatalogdetail1;
    }

    public void setTgenecatalogdetail1(Tgenecatalogdetail tgenecatalogdetail1) {
        this.tgenecatalogdetail1 = tgenecatalogdetail1;
    }

    public Tgenecatalogdetail getTgenecatalogdetail2() {
        return tgenecatalogdetail2;
    }

    public void setTgenecatalogdetail2(Tgenecatalogdetail tgenecatalogdetail2) {
        this.tgenecatalogdetail2 = tgenecatalogdetail2;
    }

    public Tgenecatalogdetail getTgenecatalogdetail3() {
        return tgenecatalogdetail3;
    }

    public void setTgenecatalogdetail3(Tgenecatalogdetail tgenecatalogdetail3) {
        this.tgenecatalogdetail3 = tgenecatalogdetail3;
    }

    public Tgenecatalogdetail getTgenecatalogdetail4() {
        return tgenecatalogdetail4;
    }

    public void setTgenecatalogdetail4(Tgenecatalogdetail tgenecatalogdetail4) {
        this.tgenecatalogdetail4 = tgenecatalogdetail4;
    }

    public Tgenecatalogdetail getTgenecatalogdetail5() {
        return tgenecatalogdetail5;
    }

    public void setTgenecatalogdetail5(Tgenecatalogdetail tgenecatalogdetail5) {
        this.tgenecatalogdetail5 = tgenecatalogdetail5;
    }

    public Tgenecatalogdetail getTgenecatalogdetail6() {
        return tgenecatalogdetail6;
    }

    public void setTgenecatalogdetail6(Tgenecatalogdetail tgenecatalogdetail6) {
        this.tgenecatalogdetail6 = tgenecatalogdetail6;
    }

    public Tgenecatalogdetail getTgenecatalogdetail7() {
        return tgenecatalogdetail7;
    }

    public void setTgenecatalogdetail7(Tgenecatalogdetail tgenecatalogdetail7) {
        this.tgenecatalogdetail7 = tgenecatalogdetail7;
    }

    @XmlTransient
    public Collection<Tarmsolicitud> getTarmsolicitudCollection() {
        return tarmsolicitudCollection;
    }

    public void setTarmsolicitudCollection(Collection<Tarmsolicitud> tarmsolicitudCollection) {
        this.tarmsolicitudCollection = tarmsolicitudCollection;
    }

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

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