/*
 * 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.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.TARMDECOMISO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmdecomiso.findAll", query = "SELECT t FROM Tarmdecomiso t"),
    @NamedQuery(name = "Tarmdecomiso.findByCdecomiso", query = "SELECT t FROM Tarmdecomiso t WHERE t.cdecomiso = :cdecomiso"),
    @NamedQuery(name = "Tarmdecomiso.findByNumerorecibo", query = "SELECT t FROM Tarmdecomiso t WHERE t.numerorecibo = :numerorecibo"),
    @NamedQuery(name = "Tarmdecomiso.findByNumerotransaccion", query = "SELECT t FROM Tarmdecomiso t WHERE t.numerotransaccion = :numerotransaccion"),
    @NamedQuery(name = "Tarmdecomiso.findByFechadecomiso", query = "SELECT t FROM Tarmdecomiso t WHERE t.fechadecomiso = :fechadecomiso"),
    @NamedQuery(name = "Tarmdecomiso.findByFecharegistro", query = "SELECT t FROM Tarmdecomiso t WHERE t.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Tarmdecomiso.findByOrganismocontrol", query = "SELECT t FROM Tarmdecomiso t WHERE t.organismocontrol = :organismocontrol"),
    @NamedQuery(name = "Tarmdecomiso.findByDireccion", query = "SELECT t FROM Tarmdecomiso t WHERE t.direccion = :direccion"),
    @NamedQuery(name = "Tarmdecomiso.findByNumerodocumento", query = "SELECT t FROM Tarmdecomiso t WHERE t.numerodocumento = :numerodocumento"),
    @NamedQuery(name = "Tarmdecomiso.findByNombrerazonsocial", query = "SELECT t FROM Tarmdecomiso t WHERE t.nombrerazonsocial = :nombrerazonsocial"),
    @NamedQuery(name = "Tarmdecomiso.findByTelefono", query = "SELECT t FROM Tarmdecomiso t WHERE t.telefono = :telefono"),
    @NamedQuery(name = "Tarmdecomiso.findByCedulafuncionario", query = "SELECT t FROM Tarmdecomiso t WHERE t.cedulafuncionario = :cedulafuncionario"),
    @NamedQuery(name = "Tarmdecomiso.findByFuncionario", query = "SELECT t FROM Tarmdecomiso t WHERE t.funcionario = :funcionario"),
    @NamedQuery(name = "Tarmdecomiso.findByLatitud", query = "SELECT t FROM Tarmdecomiso t WHERE t.latitud = :latitud"),
    @NamedQuery(name = "Tarmdecomiso.findByLongitud", query = "SELECT t FROM Tarmdecomiso t WHERE t.longitud = :longitud"),
    @NamedQuery(name = "Tarmdecomiso.findByReferencia", query = "SELECT t FROM Tarmdecomiso t WHERE t.referencia = :referencia"),
    @NamedQuery(name = "Tarmdecomiso.findByXpath", query = "SELECT t FROM Tarmdecomiso t WHERE t.xpath = :xpath"),
    @NamedQuery(name = "Tarmdecomiso.findByComprobantexpath", query = "SELECT t FROM Tarmdecomiso t WHERE t.comprobantexpath = :comprobantexpath")})
public class Tarmdecomiso implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CDECOMISO")
    private Long cdecomiso;
    @Column(name = "NUMERORECIBO")
    private String numerorecibo;
    @Column(name = "NUMEROTRANSACCION")
    private String numerotransaccion;
    @Column(name = "FECHADECOMISO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechadecomiso;
    @Column(name = "FECHAREGISTRO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Column(name = "ORGANISMOCONTROL")
    private String organismocontrol;
    @Column(name = "DIRECCION")
    private String direccion;
    @Column(name = "NUMERODOCUMENTO")
    private String numerodocumento;
    @Column(name = "NOMBRERAZONSOCIAL")
    private String nombrerazonsocial;
    @Column(name = "TELEFONO")
    private String telefono;
    @Column(name = "CEDULAFUNCIONARIO")
    private String cedulafuncionario;
    @Column(name = "FUNCIONARIO")
    private String funcionario;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "LATITUD")
    private BigDecimal latitud;
    @Column(name = "LONGITUD")
    private BigDecimal longitud;
    @Column(name = "REFERENCIA")
    private String referencia;
    @Column(name = "XPATH")
    private String xpath;
    @Column(name = "COMPROBANTEXPATH")
    private String comprobantexpath;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tarmdecomiso")
    private Collection<Tarmsanciondecomiso> tarmsanciondecomisoCollection;
    @OneToMany(mappedBy = "cdecomiso")
    private Collection<Tarmdecomisoarma> tarmdecomisoarmaCollection;
    @JoinColumn(name = "CCENTROCONTROL", referencedColumnName = "CCENTROCONTROL")
    @ManyToOne
    private Tarmcentrocontrol ccentrocontrol;
    @JoinColumn(name = "CCENTROCONTROLDESTINO", referencedColumnName = "CCENTROCONTROL")
    @ManyToOne
    private Tarmcentrocontrol ccentrocontroldestino;
    @JoinColumn(name = "PERSONCODEREGISTRA", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson personcoderegistra;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson personcode;
    @JoinColumns({
        @JoinColumn(name = "TIPOPROCESO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPOPROCESOCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "TIPODOCUMENTO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPODOCUMENTOCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "UNIDAD", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "UNIDADCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail2;
    @JoinColumns({
        @JoinColumn(name = "GRADOFUNCIONARIO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "GRADOFUNCIONARIOCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail3;
    @JoinColumns({
        @JoinColumn(name = "COUNTRYCODE", referencedColumnName = "COUNTRYCODE"),
        @JoinColumn(name = "PROVINCECODE", referencedColumnName = "PROVINCECODE"),
        @JoinColumn(name = "CANTONCODE", referencedColumnName = "CANTONCODE"),
        @JoinColumn(name = "CITYCODE", referencedColumnName = "CITYCODE")})
    @ManyToOne
    private Tgenecity tgenecity;
    @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 Tarmdecomiso() {
    }

    public Tarmdecomiso(Long cdecomiso) {
        this.cdecomiso = cdecomiso;
    }

    public Long getCdecomiso() {
        return cdecomiso;
    }

    public void setCdecomiso(Long cdecomiso) {
        this.cdecomiso = cdecomiso;
    }

    public String getNumerorecibo() {
        return numerorecibo;
    }

    public void setNumerorecibo(String numerorecibo) {
        this.numerorecibo = numerorecibo;
    }

    public String getNumerotransaccion() {
        return numerotransaccion;
    }

    public void setNumerotransaccion(String numerotransaccion) {
        this.numerotransaccion = numerotransaccion;
    }

    public Date getFechadecomiso() {
        return fechadecomiso;
    }

    public void setFechadecomiso(Date fechadecomiso) {
        this.fechadecomiso = fechadecomiso;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getOrganismocontrol() {
        return organismocontrol;
    }

    public void setOrganismocontrol(String organismocontrol) {
        this.organismocontrol = organismocontrol;
    }

    public String getDireccion() {
        return direccion;
    }

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

    public String getNumerodocumento() {
        return numerodocumento;
    }

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

    public String getNombrerazonsocial() {
        return nombrerazonsocial;
    }

    public void setNombrerazonsocial(String nombrerazonsocial) {
        this.nombrerazonsocial = nombrerazonsocial;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public String getCedulafuncionario() {
        return cedulafuncionario;
    }

    public void setCedulafuncionario(String cedulafuncionario) {
        this.cedulafuncionario = cedulafuncionario;
    }

    public String getFuncionario() {
        return funcionario;
    }

    public void setFuncionario(String funcionario) {
        this.funcionario = funcionario;
    }

    public BigDecimal getLatitud() {
        return latitud;
    }

    public void setLatitud(BigDecimal latitud) {
        this.latitud = latitud;
    }

    public BigDecimal getLongitud() {
        return longitud;
    }

    public void setLongitud(BigDecimal longitud) {
        this.longitud = longitud;
    }

    public String getReferencia() {
        return referencia;
    }

    public void setReferencia(String referencia) {
        this.referencia = referencia;
    }

    public String getXpath() {
        return xpath;
    }

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

    public String getComprobantexpath() {
        return comprobantexpath;
    }

    public void setComprobantexpath(String comprobantexpath) {
        this.comprobantexpath = comprobantexpath;
    }

    @XmlTransient
    public Collection<Tarmsanciondecomiso> getTarmsanciondecomisoCollection() {
        return tarmsanciondecomisoCollection;
    }

    public void setTarmsanciondecomisoCollection(Collection<Tarmsanciondecomiso> tarmsanciondecomisoCollection) {
        this.tarmsanciondecomisoCollection = tarmsanciondecomisoCollection;
    }

    @XmlTransient
    public Collection<Tarmdecomisoarma> getTarmdecomisoarmaCollection() {
        return tarmdecomisoarmaCollection;
    }

    public void setTarmdecomisoarmaCollection(Collection<Tarmdecomisoarma> tarmdecomisoarmaCollection) {
        this.tarmdecomisoarmaCollection = tarmdecomisoarmaCollection;
    }

    public Tarmcentrocontrol getCcentrocontrol() {
        return ccentrocontrol;
    }

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

    public Tarmcentrocontrol getCcentrocontroldestino() {
        return ccentrocontroldestino;
    }

    public void setCcentrocontroldestino(Tarmcentrocontrol ccentrocontroldestino) {
        this.ccentrocontroldestino = ccentrocontroldestino;
    }

    public Tcustperson getPersoncoderegistra() {
        return personcoderegistra;
    }

    public void setPersoncoderegistra(Tcustperson personcoderegistra) {
        this.personcoderegistra = personcoderegistra;
    }

    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;
    }

    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 Tgenecity getTgenecity() {
        return tgenecity;
    }

    public void setTgenecity(Tgenecity tgenecity) {
        this.tgenecity = tgenecity;
    }

    public Tgeneparroquia getTgeneparroquia() {
        return tgeneparroquia;
    }

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

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

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