/*
 * 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 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.ManyToMany;
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.TARMARMAS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmarmas.findAll", query = "SELECT t FROM Tarmarmas t"),
    @NamedQuery(name = "Tarmarmas.findByCarma", query = "SELECT t FROM Tarmarmas t WHERE t.carma = :carma"),
    @NamedQuery(name = "Tarmarmas.findByLote", query = "SELECT t FROM Tarmarmas t WHERE t.lote = :lote"),
    @NamedQuery(name = "Tarmarmas.findByCantidad", query = "SELECT t FROM Tarmarmas t WHERE t.cantidad = :cantidad"),
    @NamedQuery(name = "Tarmarmas.findByPeso", query = "SELECT t FROM Tarmarmas t WHERE t.peso = :peso"),
    @NamedQuery(name = "Tarmarmas.findByModelo", query = "SELECT t FROM Tarmarmas t WHERE t.modelo = :modelo"),
    @NamedQuery(name = "Tarmarmas.findBySeriecanon", query = "SELECT t FROM Tarmarmas t WHERE t.seriecanon = :seriecanon"),
    @NamedQuery(name = "Tarmarmas.findByFemisionpermiso", query = "SELECT t FROM Tarmarmas t WHERE t.femisionpermiso = :femisionpermiso"),
    @NamedQuery(name = "Tarmarmas.findByDireccion", query = "SELECT t FROM Tarmarmas t WHERE t.direccion = :direccion"),
    @NamedQuery(name = "Tarmarmas.findByNemonicoarma", query = "SELECT t FROM Tarmarmas t WHERE t.nemonicoarma = :nemonicoarma"),
    @NamedQuery(name = "Tarmarmas.findByFecharegistro", query = "SELECT t FROM Tarmarmas t WHERE t.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Tarmarmas.findByRecordversion", query = "SELECT t FROM Tarmarmas t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tarmarmas.findByCodigoarma", query = "SELECT t FROM Tarmarmas t WHERE t.codigoarma = :codigoarma"),
    @NamedQuery(name = "Tarmarmas.findByFdesaduanizacion", query = "SELECT t FROM Tarmarmas t WHERE t.fdesaduanizacion = :fdesaduanizacion"),
    @NamedQuery(name = "Tarmarmas.findByFechacaducidad", query = "SELECT t FROM Tarmarmas t WHERE t.fechacaducidad = :fechacaducidad"),
    @NamedQuery(name = "Tarmarmas.findByPartidaarancelaria", query = "SELECT t FROM Tarmarmas t WHERE t.partidaarancelaria = :partidaarancelaria"),
    @NamedQuery(name = "Tarmarmas.findByPartidaarancelariacodigo", query = "SELECT t FROM Tarmarmas t WHERE t.partidaarancelariacodigo = :partidaarancelariacodigo"),
    @NamedQuery(name = "Tarmarmas.findByEstadodecomiso", query = "SELECT t FROM Tarmarmas t WHERE t.estadodecomiso = :estadodecomiso"),
    @NamedQuery(name = "Tarmarmas.findByEstadoventa", query = "SELECT t FROM Tarmarmas t WHERE t.estadoventa = :estadoventa"),
    @NamedQuery(name = "Tarmarmas.findByPathdocumento", query = "SELECT t FROM Tarmarmas t WHERE t.pathdocumento = :pathdocumento"),
    @NamedQuery(name = "Tarmarmas.findByPathdocumentocrear", query = "SELECT t FROM Tarmarmas t WHERE t.pathdocumentocrear = :pathdocumentocrear"),
    @NamedQuery(name = "Tarmarmas.findByGeneracertificado", query = "SELECT t FROM Tarmarmas t WHERE t.generacertificado = :generacertificado")})
public class Tarmarmas implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CARMA")
    private String carma;
    @Column(name = "LOTE")
    private String lote;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "CANTIDAD")
    private BigDecimal cantidad;
    @Column(name = "PESO")
    private BigDecimal peso;
    @Column(name = "MODELO")
    private String modelo;
    @Column(name = "SERIECANON")
    private String seriecanon;
    @Column(name = "FEMISIONPERMISO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date femisionpermiso;
    @Column(name = "DIRECCION")
    private String direccion;
    @Column(name = "NEMONICOARMA")
    private String nemonicoarma;
    @Column(name = "FECHAREGISTRO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "CODIGOARMA")
    private String codigoarma;
    @Column(name = "FDESADUANIZACION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fdesaduanizacion;
    @Column(name = "FECHACADUCIDAD")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechacaducidad;
    @Column(name = "PARTIDAARANCELARIA")
    private String partidaarancelaria;
    @Column(name = "PARTIDAARANCELARIACODIGO")
    private String partidaarancelariacodigo;
    @Column(name = "ESTADODECOMISO")
    private String estadodecomiso;
    @Column(name = "ESTADOVENTA")
    private String estadoventa;
    @Column(name = "PATHDOCUMENTO")
    private String pathdocumento;
    @Column(name = "PATHDOCUMENTOCREAR")
    private String pathdocumentocrear;
    @Column(name = "GENERACERTIFICADO")
    private String generacertificado;
    @ManyToMany(mappedBy = "tarmarmasCollection")
    private Collection<Tarmagenciasucursal> tarmagenciasucursalCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tarmarmas")
    private Collection<Tarmsolicitudarmas> tarmsolicitudarmasCollection;
    @OneToMany(mappedBy = "carma")
    private Collection<Tarmdocumentohabilitante> tarmdocumentohabilitanteCollection;
    @JoinColumn(name = "CREGISTRO", referencedColumnName = "CREGISTRO")
    @ManyToOne
    private Tarmregistroarmas cregistro;
    @JoinColumn(name = "CTIPOARMAEXPLOSIVO", referencedColumnName = "CTIPOARMAEXPLOSIVO")
    @ManyToOne
    private Tarmtipoarmaexplosivo ctipoarmaexplosivo;
    @JoinColumns({
        @JoinColumn(name = "MARCA", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "MARCACODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "ESTADO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "ESTADOCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "COLOR", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "COLORCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail2;
    @JoinColumns({
        @JoinColumn(name = "TIPOFABRICACION", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPOFABRICACIONCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail3;
    @JoinColumns({
        @JoinColumn(name = "UNIDADMEDIDACANTIDAD", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "UNIDADMEDIDACANTIDADCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail4;
    @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;
    @JoinColumn(name = "CPAISORIGEN", referencedColumnName = "COUNTRYCODE")
    @ManyToOne
    private Tgenecountry cpaisorigen;
    @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;
    @OneToMany(mappedBy = "carma")
    private Collection<Tarmtransaccionarmabodega> tarmtransaccionarmabodegaCollection;
    @OneToMany(mappedBy = "carma")
    private Collection<Tarmmovimientoarmas> tarmmovimientoarmasCollection;
    @OneToMany(mappedBy = "carma")
    private Collection<Tarmsanciondecomiso> tarmsanciondecomisoCollection;
    @OneToMany(mappedBy = "carma")
    private Collection<Tarmdecomisoarma> tarmdecomisoarmaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tarmarmas")
    private Collection<Tarmtagarma> tarmtagarmaCollection;
    @OneToMany(mappedBy = "carma")
    private Collection<Tarmbodega> tarmbodegaCollection;
    @OneToMany(mappedBy = "carma")
    private Collection<Tarmtotalpersona> tarmtotalpersonaCollection;

    public Tarmarmas() {
    }

    public Tarmarmas(String carma) {
        this.carma = carma;
    }

    public String getCarma() {
        return carma;
    }

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

    public String getLote() {
        return lote;
    }

    public void setLote(String lote) {
        this.lote = lote;
    }

    public BigDecimal getCantidad() {
        return cantidad;
    }

    public void setCantidad(BigDecimal cantidad) {
        this.cantidad = cantidad;
    }

    public BigDecimal getPeso() {
        return peso;
    }

    public void setPeso(BigDecimal peso) {
        this.peso = peso;
    }

    public String getModelo() {
        return modelo;
    }

    public void setModelo(String modelo) {
        this.modelo = modelo;
    }

    public String getSeriecanon() {
        return seriecanon;
    }

    public void setSeriecanon(String seriecanon) {
        this.seriecanon = seriecanon;
    }

    public Date getFemisionpermiso() {
        return femisionpermiso;
    }

    public void setFemisionpermiso(Date femisionpermiso) {
        this.femisionpermiso = femisionpermiso;
    }

    public String getDireccion() {
        return direccion;
    }

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

    public String getNemonicoarma() {
        return nemonicoarma;
    }

    public void setNemonicoarma(String nemonicoarma) {
        this.nemonicoarma = nemonicoarma;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

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

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getCodigoarma() {
        return codigoarma;
    }

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

    public Date getFdesaduanizacion() {
        return fdesaduanizacion;
    }

    public void setFdesaduanizacion(Date fdesaduanizacion) {
        this.fdesaduanizacion = fdesaduanizacion;
    }

    public Date getFechacaducidad() {
        return fechacaducidad;
    }

    public void setFechacaducidad(Date fechacaducidad) {
        this.fechacaducidad = fechacaducidad;
    }

    public String getPartidaarancelaria() {
        return partidaarancelaria;
    }

    public void setPartidaarancelaria(String partidaarancelaria) {
        this.partidaarancelaria = partidaarancelaria;
    }

    public String getPartidaarancelariacodigo() {
        return partidaarancelariacodigo;
    }

    public void setPartidaarancelariacodigo(String partidaarancelariacodigo) {
        this.partidaarancelariacodigo = partidaarancelariacodigo;
    }

    public String getEstadodecomiso() {
        return estadodecomiso;
    }

    public void setEstadodecomiso(String estadodecomiso) {
        this.estadodecomiso = estadodecomiso;
    }

    public String getEstadoventa() {
        return estadoventa;
    }

    public void setEstadoventa(String estadoventa) {
        this.estadoventa = estadoventa;
    }

    public String getPathdocumento() {
        return pathdocumento;
    }

    public void setPathdocumento(String pathdocumento) {
        this.pathdocumento = pathdocumento;
    }

    public String getPathdocumentocrear() {
        return pathdocumentocrear;
    }

    public void setPathdocumentocrear(String pathdocumentocrear) {
        this.pathdocumentocrear = pathdocumentocrear;
    }

    public String getGeneracertificado() {
        return generacertificado;
    }

    public void setGeneracertificado(String generacertificado) {
        this.generacertificado = generacertificado;
    }

    @XmlTransient
    public Collection<Tarmagenciasucursal> getTarmagenciasucursalCollection() {
        return tarmagenciasucursalCollection;
    }

    public void setTarmagenciasucursalCollection(Collection<Tarmagenciasucursal> tarmagenciasucursalCollection) {
        this.tarmagenciasucursalCollection = tarmagenciasucursalCollection;
    }

    @XmlTransient
    public Collection<Tarmsolicitudarmas> getTarmsolicitudarmasCollection() {
        return tarmsolicitudarmasCollection;
    }

    public void setTarmsolicitudarmasCollection(Collection<Tarmsolicitudarmas> tarmsolicitudarmasCollection) {
        this.tarmsolicitudarmasCollection = tarmsolicitudarmasCollection;
    }

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

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

    public Tarmregistroarmas getCregistro() {
        return cregistro;
    }

    public void setCregistro(Tarmregistroarmas cregistro) {
        this.cregistro = cregistro;
    }

    public Tarmtipoarmaexplosivo getCtipoarmaexplosivo() {
        return ctipoarmaexplosivo;
    }

    public void setCtipoarmaexplosivo(Tarmtipoarmaexplosivo ctipoarmaexplosivo) {
        this.ctipoarmaexplosivo = ctipoarmaexplosivo;
    }

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

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

    public Tgenecountry getCpaisorigen() {
        return cpaisorigen;
    }

    public void setCpaisorigen(Tgenecountry cpaisorigen) {
        this.cpaisorigen = cpaisorigen;
    }

    public Tgeneparroquia getTgeneparroquia() {
        return tgeneparroquia;
    }

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

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

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

    @XmlTransient
    public Collection<Tarmmovimientoarmas> getTarmmovimientoarmasCollection() {
        return tarmmovimientoarmasCollection;
    }

    public void setTarmmovimientoarmasCollection(Collection<Tarmmovimientoarmas> tarmmovimientoarmasCollection) {
        this.tarmmovimientoarmasCollection = tarmmovimientoarmasCollection;
    }

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

    @XmlTransient
    public Collection<Tarmtagarma> getTarmtagarmaCollection() {
        return tarmtagarmaCollection;
    }

    public void setTarmtagarmaCollection(Collection<Tarmtagarma> tarmtagarmaCollection) {
        this.tarmtagarmaCollection = tarmtagarmaCollection;
    }

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

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

    @XmlTransient
    public Collection<Tarmtotalpersona> getTarmtotalpersonaCollection() {
        return tarmtotalpersonaCollection;
    }

    public void setTarmtotalpersonaCollection(Collection<Tarmtotalpersona> tarmtotalpersonaCollection) {
        this.tarmtotalpersonaCollection = tarmtotalpersonaCollection;
    }

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

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