/*
 * 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 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.OneToOne;
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.TARMCENTROCONTROL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmcentrocontrol.findAll", query = "SELECT t FROM Tarmcentrocontrol t"),
    @NamedQuery(name = "Tarmcentrocontrol.findByCcentrocontrol", query = "SELECT t FROM Tarmcentrocontrol t WHERE t.ccentrocontrol = :ccentrocontrol"),
    @NamedQuery(name = "Tarmcentrocontrol.findByRecordversion", query = "SELECT t FROM Tarmcentrocontrol t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tarmcentrocontrol.findByDireccion", query = "SELECT t FROM Tarmcentrocontrol t WHERE t.direccion = :direccion"),
    @NamedQuery(name = "Tarmcentrocontrol.findByTramitespordia", query = "SELECT t FROM Tarmcentrocontrol t WHERE t.tramitespordia = :tramitespordia"),
    @NamedQuery(name = "Tarmcentrocontrol.findByFechaproximotramite", query = "SELECT t FROM Tarmcentrocontrol t WHERE t.fechaproximotramite = :fechaproximotramite"),
    @NamedQuery(name = "Tarmcentrocontrol.findByCuposlibresultimodia", query = "SELECT t FROM Tarmcentrocontrol t WHERE t.cuposlibresultimodia = :cuposlibresultimodia"),
    @NamedQuery(name = "Tarmcentrocontrol.findByEstado", query = "SELECT t FROM Tarmcentrocontrol t WHERE t.estado = :estado")})
public class Tarmcentrocontrol implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CCENTROCONTROL")
    private String ccentrocontrol;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DIRECCION")
    private String direccion;
    @Column(name = "TRAMITESPORDIA")
    private Integer tramitespordia;
    @Column(name = "FECHAPROXIMOTRAMITE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaproximotramite;
    @Column(name = "CUPOSLIBRESULTIMODIA")
    private Integer cuposlibresultimodia;
    @Column(name = "ESTADO")
    private String estado;
    @OneToMany(mappedBy = "ccentrocontroldestino")
    private Collection<Tarmtransaccionarmabodega> tarmtransaccionarmabodegaCollection;
    @OneToMany(mappedBy = "ccentrocontrolorigen")
    private Collection<Tarmtransaccionarmabodega> tarmtransaccionarmabodegaCollection1;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ccentrocontrol")
    private Collection<Tarmtramitesatendidos> tarmtramitesatendidosCollection;
    @OneToMany(mappedBy = "ccentrocontrol")
    private Collection<Tarmplanificacioninspeccion> tarmplanificacioninspeccionCollection;
    @OneToMany(mappedBy = "ccentrocontrol")
    private Collection<Tarmcencontroljur> tarmcencontroljurCollection;
    @OneToMany(mappedBy = "ccentrocontrol")
    private Collection<Tarmbodega> tarmbodegaCollection;
    @OneToMany(mappedBy = "ccentrocontrol")
    private Collection<Tarmdecomiso> tarmdecomisoCollection;
    @OneToMany(mappedBy = "ccentrocontroldestino")
    private Collection<Tarmdecomiso> tarmdecomisoCollection1;
    @OneToMany(mappedBy = "ccentrocontrol")
    private Collection<Tarmsolicitud> tarmsolicitudCollection;
    @OneToMany(mappedBy = "ccentrocontrol")
    private Collection<Tarmcustodiatemporal> tarmcustodiatemporalCollection;
    @JoinColumns({
        @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE"),
        @JoinColumn(name = "DATETO", referencedColumnName = "DATETO")})
    @ManyToOne
    private Tcustpersondetail tcustpersondetail;
    @JoinColumns({
        @JoinColumn(name = "NOMBREINSTITUCION", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "NOMBREINSTITUCIONCODIGO", referencedColumnName = "CATALOGCODE")})
    @OneToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "GRADO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "GRADOCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "INSTITUCION", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "INSTITUCIONTIPO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail2;
    @JoinColumns({
        @JoinColumn(name = "COUNTRYCODE", referencedColumnName = "COUNTRYCODE"),
        @JoinColumn(name = "PROVINCECODE", referencedColumnName = "PROVINCECODE"),
        @JoinColumn(name = "CANTONCODE", referencedColumnName = "CANTONCODE"),
        @JoinColumn(name = "PARROQUIACODE", referencedColumnName = "PARROQUIACODE")})
    @ManyToOne
    private Tgeneparroquia tgeneparroquia;

    public Tarmcentrocontrol() {
    }

    public Tarmcentrocontrol(String ccentrocontrol) {
        this.ccentrocontrol = ccentrocontrol;
    }

    public String getCcentrocontrol() {
        return ccentrocontrol;
    }

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

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public Integer getTramitespordia() {
        return tramitespordia;
    }

    public void setTramitespordia(Integer tramitespordia) {
        this.tramitespordia = tramitespordia;
    }

    public Date getFechaproximotramite() {
        return fechaproximotramite;
    }

    public void setFechaproximotramite(Date fechaproximotramite) {
        this.fechaproximotramite = fechaproximotramite;
    }

    public Integer getCuposlibresultimodia() {
        return cuposlibresultimodia;
    }

    public void setCuposlibresultimodia(Integer cuposlibresultimodia) {
        this.cuposlibresultimodia = cuposlibresultimodia;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    @XmlTransient
    public Collection<Tarmtransaccionarmabodega> getTarmtransaccionarmabodegaCollection() {
        return tarmtransaccionarmabodegaCollection;
    }

    public void setTarmtransaccionarmabodegaCollection(Collection<Tarmtransaccionarmabodega> tarmtransaccionarmabodegaCollection) {
        this.tarmtransaccionarmabodegaCollection = tarmtransaccionarmabodegaCollection;
    }

    @XmlTransient
    public Collection<Tarmtransaccionarmabodega> getTarmtransaccionarmabodegaCollection1() {
        return tarmtransaccionarmabodegaCollection1;
    }

    public void setTarmtransaccionarmabodegaCollection1(Collection<Tarmtransaccionarmabodega> tarmtransaccionarmabodegaCollection1) {
        this.tarmtransaccionarmabodegaCollection1 = tarmtransaccionarmabodegaCollection1;
    }

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

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

    @XmlTransient
    public Collection<Tarmplanificacioninspeccion> getTarmplanificacioninspeccionCollection() {
        return tarmplanificacioninspeccionCollection;
    }

    public void setTarmplanificacioninspeccionCollection(Collection<Tarmplanificacioninspeccion> tarmplanificacioninspeccionCollection) {
        this.tarmplanificacioninspeccionCollection = tarmplanificacioninspeccionCollection;
    }

    @XmlTransient
    public Collection<Tarmcencontroljur> getTarmcencontroljurCollection() {
        return tarmcencontroljurCollection;
    }

    public void setTarmcencontroljurCollection(Collection<Tarmcencontroljur> tarmcencontroljurCollection) {
        this.tarmcencontroljurCollection = tarmcencontroljurCollection;
    }

    @XmlTransient
    public Collection<Tarmbodega> getTarmbodegaCollection() {
        return tarmbodegaCollection;
    }

    public void setTarmbodegaCollection(Collection<Tarmbodega> tarmbodegaCollection) {
        this.tarmbodegaCollection = tarmbodegaCollection;
    }

    @XmlTransient
    public Collection<Tarmdecomiso> getTarmdecomisoCollection() {
        return tarmdecomisoCollection;
    }

    public void setTarmdecomisoCollection(Collection<Tarmdecomiso> tarmdecomisoCollection) {
        this.tarmdecomisoCollection = tarmdecomisoCollection;
    }

    @XmlTransient
    public Collection<Tarmdecomiso> getTarmdecomisoCollection1() {
        return tarmdecomisoCollection1;
    }

    public void setTarmdecomisoCollection1(Collection<Tarmdecomiso> tarmdecomisoCollection1) {
        this.tarmdecomisoCollection1 = tarmdecomisoCollection1;
    }

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

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

    @XmlTransient
    public Collection<Tarmcustodiatemporal> getTarmcustodiatemporalCollection() {
        return tarmcustodiatemporalCollection;
    }

    public void setTarmcustodiatemporalCollection(Collection<Tarmcustodiatemporal> tarmcustodiatemporalCollection) {
        this.tarmcustodiatemporalCollection = tarmcustodiatemporalCollection;
    }

    public Tcustpersondetail getTcustpersondetail() {
        return tcustpersondetail;
    }

    public void setTcustpersondetail(Tcustpersondetail tcustpersondetail) {
        this.tcustpersondetail = tcustpersondetail;
    }

    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 Tgeneparroquia getTgeneparroquia() {
        return tgeneparroquia;
    }

    public void setTgeneparroquia(Tgeneparroquia tgeneparroquia) {
        this.tgeneparroquia = tgeneparroquia;
    }

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

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