/*
 * 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.TARMDECOMISOARMA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmdecomisoarma.findAll", query = "SELECT t FROM Tarmdecomisoarma t"),
    @NamedQuery(name = "Tarmdecomisoarma.findByCdecomisoarma", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.cdecomisoarma = :cdecomisoarma"),
    @NamedQuery(name = "Tarmdecomisoarma.findByFdecomiso", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.fdecomiso = :fdecomiso"),
    @NamedQuery(name = "Tarmdecomisoarma.findByCantidad", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.cantidad = :cantidad"),
    @NamedQuery(name = "Tarmdecomisoarma.findByObservacion", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.observacion = :observacion"),
    @NamedQuery(name = "Tarmdecomisoarma.findByEstadoanterior", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.estadoanterior = :estadoanterior"),
    @NamedQuery(name = "Tarmdecomisoarma.findByTiporegistroanterior", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.tiporegistroanterior = :tiporegistroanterior"),
    @NamedQuery(name = "Tarmdecomisoarma.findByEnbodega", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.enbodega = :enbodega"),
    @NamedQuery(name = "Tarmdecomisoarma.findByCdecarmtranrecepcion", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.cdecarmtranrecepcion = :cdecarmtranrecepcion"),
    @NamedQuery(name = "Tarmdecomisoarma.findByNumerotransaccion", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.numerotransaccion = :numerotransaccion"),
    @NamedQuery(name = "Tarmdecomisoarma.findByCoperaciontransaccion", query = "SELECT t FROM Tarmdecomisoarma t WHERE t.coperaciontransaccion = :coperaciontransaccion")})
public class Tarmdecomisoarma implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CDECOMISOARMA")
    private String cdecomisoarma;
    @Column(name = "FDECOMISO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fdecomiso;
    // @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 = "OBSERVACION")
    private String observacion;
    @Column(name = "ESTADOANTERIOR")
    private String estadoanterior;
    @Column(name = "TIPOREGISTROANTERIOR")
    private String tiporegistroanterior;
    @Column(name = "ENBODEGA")
    private String enbodega;
    @Column(name = "CDECARMTRANRECEPCION")
    private Long cdecarmtranrecepcion;
    @Column(name = "NUMEROTRANSACCION")
    private String numerotransaccion;
    @Column(name = "COPERACIONTRANSACCION")
    private String coperaciontransaccion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cdecomisoarma")
    private Collection<Tarmdetrepdestruirarmas> tarmdetrepdestruirarmasCollection;
    @JoinColumn(name = "CARMA", referencedColumnName = "CARMA")
    @ManyToOne
    private Tarmarmas carma;
    @JoinColumn(name = "CCUSTEMP", referencedColumnName = "CCUSTEMP")
    @ManyToOne
    private Tarmcustodiatemporal ccustemp;
    @JoinColumn(name = "CDECOMISO", referencedColumnName = "CDECOMISO")
    @ManyToOne
    private Tarmdecomiso cdecomiso;
    @JoinColumn(name = "CDECOMISOARMATRANSACCION", referencedColumnName = "CDECOMISOARMATRANSACCION")
    @ManyToOne
    private Tarmdecomisoarmatransaccion cdecomisoarmatransaccion;
    @JoinColumns({
        @JoinColumn(name = "ESTADO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "ESTADOCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "ADESTRUIRSE", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "ADESTRUIRSECODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @JoinColumns({
        @JoinColumn(name = "MOTIVODECOMISO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "MOTIVODECOMISOCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail2;
    @JoinColumns({
        @JoinColumn(name = "UNIDADMEDIDA", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "UNIDADMEDIDACODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail3;

    public Tarmdecomisoarma() {
    }

    public Tarmdecomisoarma(String cdecomisoarma) {
        this.cdecomisoarma = cdecomisoarma;
    }

    public String getCdecomisoarma() {
        return cdecomisoarma;
    }

    public void setCdecomisoarma(String cdecomisoarma) {
        this.cdecomisoarma = cdecomisoarma;
    }

    public Date getFdecomiso() {
        return fdecomiso;
    }

    public void setFdecomiso(Date fdecomiso) {
        this.fdecomiso = fdecomiso;
    }

    public BigDecimal getCantidad() {
        return cantidad;
    }

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

    public String getObservacion() {
        return observacion;
    }

    public void setObservacion(String observacion) {
        this.observacion = observacion;
    }

    public String getEstadoanterior() {
        return estadoanterior;
    }

    public void setEstadoanterior(String estadoanterior) {
        this.estadoanterior = estadoanterior;
    }

    public String getTiporegistroanterior() {
        return tiporegistroanterior;
    }

    public void setTiporegistroanterior(String tiporegistroanterior) {
        this.tiporegistroanterior = tiporegistroanterior;
    }

    public String getEnbodega() {
        return enbodega;
    }

    public void setEnbodega(String enbodega) {
        this.enbodega = enbodega;
    }

    public Long getCdecarmtranrecepcion() {
        return cdecarmtranrecepcion;
    }

    public void setCdecarmtranrecepcion(Long cdecarmtranrecepcion) {
        this.cdecarmtranrecepcion = cdecarmtranrecepcion;
    }

    public String getNumerotransaccion() {
        return numerotransaccion;
    }

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

    public String getCoperaciontransaccion() {
        return coperaciontransaccion;
    }

    public void setCoperaciontransaccion(String coperaciontransaccion) {
        this.coperaciontransaccion = coperaciontransaccion;
    }

    @XmlTransient
    public Collection<Tarmdetrepdestruirarmas> getTarmdetrepdestruirarmasCollection() {
        return tarmdetrepdestruirarmasCollection;
    }

    public void setTarmdetrepdestruirarmasCollection(Collection<Tarmdetrepdestruirarmas> tarmdetrepdestruirarmasCollection) {
        this.tarmdetrepdestruirarmasCollection = tarmdetrepdestruirarmasCollection;
    }

    public Tarmarmas getCarma() {
        return carma;
    }

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

    public Tarmcustodiatemporal getCcustemp() {
        return ccustemp;
    }

    public void setCcustemp(Tarmcustodiatemporal ccustemp) {
        this.ccustemp = ccustemp;
    }

    public Tarmdecomiso getCdecomiso() {
        return cdecomiso;
    }

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

    public Tarmdecomisoarmatransaccion getCdecomisoarmatransaccion() {
        return cdecomisoarmatransaccion;
    }

    public void setCdecomisoarmatransaccion(Tarmdecomisoarmatransaccion cdecomisoarmatransaccion) {
        this.cdecomisoarmatransaccion = cdecomisoarmatransaccion;
    }

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

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

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

}
