/*
 * 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.BigInteger;
import java.util.Collection;
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.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TARMTIPOARMAEXPLOSIVO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmtipoarmaexplosivo.findAll", query = "SELECT t FROM Tarmtipoarmaexplosivo t"),
    @NamedQuery(name = "Tarmtipoarmaexplosivo.findByCtipoarmaexplosivo", query = "SELECT t FROM Tarmtipoarmaexplosivo t WHERE t.ctipoarmaexplosivo = :ctipoarmaexplosivo"),
    @NamedQuery(name = "Tarmtipoarmaexplosivo.findByRecordversion", query = "SELECT t FROM Tarmtipoarmaexplosivo t WHERE t.recordversion = :recordversion")})
public class Tarmtipoarmaexplosivo implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CTIPOARMAEXPLOSIVO")
    private String ctipoarmaexplosivo;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @JoinColumns({
        @JoinColumn(name = "CLASE", referencedColumnName = "CLASE"),
        @JoinColumn(name = "CLASECODIGO", referencedColumnName = "CLASECODE"),
        @JoinColumn(name = "TIPOARMAEXPLOSIVO", referencedColumnName = "TIPOARMAEXPLOSIVO"),
        @JoinColumn(name = "TIPOARMAEXPLOSIVOCODIGO", referencedColumnName = "TIPOARMAEXPLOSIVOCODIGO"),
        @JoinColumn(name = "UNIDADMEDIDAPESO", referencedColumnName = "UNIDADMEDIDAPESO"),
        @JoinColumn(name = "UNIDADMEDIDAPESOCODIGO", referencedColumnName = "UNIDADMEDIDAPESOCODIGO")})
    @ManyToOne
    private Tarmunidadtipo tarmunidadtipo;
    @JoinColumns({
        @JoinColumn(name = "LONGITUD", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "LONGITUDCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;
    @JoinColumns({
        @JoinColumn(name = "CALIBRE", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "CALIBRECODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail1;
    @OneToMany(mappedBy = "ctipoarmaexplosivo")
    private Collection<Tarmarmas> tarmarmasCollection;

    public Tarmtipoarmaexplosivo() {
    }

    public Tarmtipoarmaexplosivo(String ctipoarmaexplosivo) {
        this.ctipoarmaexplosivo = ctipoarmaexplosivo;
    }

    public String getCtipoarmaexplosivo() {
        return ctipoarmaexplosivo;
    }

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

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Tarmunidadtipo getTarmunidadtipo() {
        return tarmunidadtipo;
    }

    public void setTarmunidadtipo(Tarmunidadtipo tarmunidadtipo) {
        this.tarmunidadtipo = tarmunidadtipo;
    }

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

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

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

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

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