/*
 * 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.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.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TARMTRANSACCIONARMABODEGA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmtransaccionarmabodega.findAll", query = "SELECT t FROM Tarmtransaccionarmabodega t"),
    @NamedQuery(name = "Tarmtransaccionarmabodega.findByCtranarmbodega", query = "SELECT t FROM Tarmtransaccionarmabodega t WHERE t.ctranarmbodega = :ctranarmbodega"),
    @NamedQuery(name = "Tarmtransaccionarmabodega.findByFecha", query = "SELECT t FROM Tarmtransaccionarmabodega t WHERE t.fecha = :fecha")})
public class Tarmtransaccionarmabodega implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CTRANARMBODEGA")
    private Long ctranarmbodega;
    @Column(name = "FECHA")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @JoinColumn(name = "CARMA", referencedColumnName = "CARMA")
    @ManyToOne
    private Tarmarmas carma;
    @JoinColumn(name = "CCENTROCONTROLDESTINO", referencedColumnName = "CCENTROCONTROL")
    @ManyToOne
    private Tarmcentrocontrol ccentrocontroldestino;
    @JoinColumn(name = "CCENTROCONTROLORIGEN", referencedColumnName = "CCENTROCONTROL")
    @ManyToOne
    private Tarmcentrocontrol ccentrocontrolorigen;
    @JoinColumn(name = "CDECOMISOARMATRANSACCION", referencedColumnName = "CDECOMISOARMATRANSACCION")
    @ManyToOne
    private Tarmdecomisoarmatransaccion cdecomisoarmatransaccion;
    @JoinColumns({
        @JoinColumn(name = "OPERACION", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "OPERACIONCODE", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;

    public Tarmtransaccionarmabodega() {
    }

    public Tarmtransaccionarmabodega(Long ctranarmbodega) {
        this.ctranarmbodega = ctranarmbodega;
    }

    public Long getCtranarmbodega() {
        return ctranarmbodega;
    }

    public void setCtranarmbodega(Long ctranarmbodega) {
        this.ctranarmbodega = ctranarmbodega;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Tarmarmas getCarma() {
        return carma;
    }

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

    public Tarmcentrocontrol getCcentrocontroldestino() {
        return ccentrocontroldestino;
    }

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

    public Tarmcentrocontrol getCcentrocontrolorigen() {
        return ccentrocontrolorigen;
    }

    public void setCcentrocontrolorigen(Tarmcentrocontrol ccentrocontrolorigen) {
        this.ccentrocontrolorigen = ccentrocontrolorigen;
    }

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

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

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