/*
 * 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.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.TARMREGISTROARMAS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmregistroarmas.findAll", query = "SELECT t FROM Tarmregistroarmas t"),
    @NamedQuery(name = "Tarmregistroarmas.findByCregistro", query = "SELECT t FROM Tarmregistroarmas t WHERE t.cregistro = :cregistro"),
    @NamedQuery(name = "Tarmregistroarmas.findByFcreacion", query = "SELECT t FROM Tarmregistroarmas t WHERE t.fcreacion = :fcreacion"),
    @NamedQuery(name = "Tarmregistroarmas.findByFabricante", query = "SELECT t FROM Tarmregistroarmas t WHERE t.fabricante = :fabricante"),
    @NamedQuery(name = "Tarmregistroarmas.findByDui", query = "SELECT t FROM Tarmregistroarmas t WHERE t.dui = :dui"),
    @NamedQuery(name = "Tarmregistroarmas.findByTotalfob", query = "SELECT t FROM Tarmregistroarmas t WHERE t.totalfob = :totalfob"),
    @NamedQuery(name = "Tarmregistroarmas.findByRecordversion", query = "SELECT t FROM Tarmregistroarmas t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tarmregistroarmas.findByTramite", query = "SELECT t FROM Tarmregistroarmas t WHERE t.tramite = :tramite"),
    @NamedQuery(name = "Tarmregistroarmas.findByAeropuertopuerto", query = "SELECT t FROM Tarmregistroarmas t WHERE t.aeropuertopuerto = :aeropuertopuerto"),
    @NamedQuery(name = "Tarmregistroarmas.findByFechasolicitud", query = "SELECT t FROM Tarmregistroarmas t WHERE t.fechasolicitud = :fechasolicitud"),
    @NamedQuery(name = "Tarmregistroarmas.findBySolicitudnum", query = "SELECT t FROM Tarmregistroarmas t WHERE t.solicitudnum = :solicitudnum")})
public class Tarmregistroarmas implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CREGISTRO")
    private Long cregistro;
    @Column(name = "FCREACION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fcreacion;
    @Column(name = "FABRICANTE")
    private String fabricante;
    @Column(name = "DUI")
    private String dui;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "TOTALFOB")
    private BigDecimal totalfob;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "TRAMITE")
    private Long tramite;
    @Column(name = "AEROPUERTOPUERTO")
    private String aeropuertopuerto;
    @Column(name = "FECHASOLICITUD")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechasolicitud;
    @Column(name = "SOLICITUDNUM")
    private String solicitudnum;
    @OneToMany(mappedBy = "cregistro")
    private Collection<Tarmarmas> tarmarmasCollection;
    @JoinColumn(name = "PERSONCODE", referencedColumnName = "PERSONCODE")
    @ManyToOne(optional = false)
    private Tcustperson personcode;
    @JoinColumns({
        @JoinColumn(name = "TIPOREGISTRO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPOREGISTROCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumn(name = "PAISORIGEN", referencedColumnName = "COUNTRYCODE")
    @ManyToOne
    private Tgenecountry paisorigen;

    public Tarmregistroarmas() {
    }

    public Tarmregistroarmas(Long cregistro) {
        this.cregistro = cregistro;
    }

    public Long getCregistro() {
        return cregistro;
    }

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

    public Date getFcreacion() {
        return fcreacion;
    }

    public void setFcreacion(Date fcreacion) {
        this.fcreacion = fcreacion;
    }

    public String getFabricante() {
        return fabricante;
    }

    public void setFabricante(String fabricante) {
        this.fabricante = fabricante;
    }

    public String getDui() {
        return dui;
    }

    public void setDui(String dui) {
        this.dui = dui;
    }

    public BigDecimal getTotalfob() {
        return totalfob;
    }

    public void setTotalfob(BigDecimal totalfob) {
        this.totalfob = totalfob;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Long getTramite() {
        return tramite;
    }

    public void setTramite(Long tramite) {
        this.tramite = tramite;
    }

    public String getAeropuertopuerto() {
        return aeropuertopuerto;
    }

    public void setAeropuertopuerto(String aeropuertopuerto) {
        this.aeropuertopuerto = aeropuertopuerto;
    }

    public Date getFechasolicitud() {
        return fechasolicitud;
    }

    public void setFechasolicitud(Date fechasolicitud) {
        this.fechasolicitud = fechasolicitud;
    }

    public String getSolicitudnum() {
        return solicitudnum;
    }

    public void setSolicitudnum(String solicitudnum) {
        this.solicitudnum = solicitudnum;
    }

    @XmlTransient
    public Collection<Tarmarmas> getTarmarmasCollection() {
        return tarmarmasCollection;
    }

    public void setTarmarmasCollection(Collection<Tarmarmas> tarmarmasCollection) {
        this.tarmarmasCollection = tarmarmasCollection;
    }

    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 Tgenecountry getPaisorigen() {
        return paisorigen;
    }

    public void setPaisorigen(Tgenecountry paisorigen) {
        this.paisorigen = paisorigen;
    }

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

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