/*
 * 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.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.TARMCOMERCIANTECUPO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmcomerciantecupo.findAll", query = "SELECT t FROM Tarmcomerciantecupo t"),
    @NamedQuery(name = "Tarmcomerciantecupo.findByCcomcupo", query = "SELECT t FROM Tarmcomerciantecupo t WHERE t.ccomcupo = :ccomcupo"),
    @NamedQuery(name = "Tarmcomerciantecupo.findByCupounidad", query = "SELECT t FROM Tarmcomerciantecupo t WHERE t.cupounidad = :cupounidad"),
    @NamedQuery(name = "Tarmcomerciantecupo.findByRecordversion", query = "SELECT t FROM Tarmcomerciantecupo t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tarmcomerciantecupo.findByFecharegistro", query = "SELECT t FROM Tarmcomerciantecupo t WHERE t.fecharegistro = :fecharegistro")})
public class Tarmcomerciantecupo implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CCOMCUPO")
    private String ccomcupo;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "CUPOUNIDAD")
    private BigDecimal cupounidad;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "FECHAREGISTRO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @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;
    @JoinColumn(name = "PERSONCODIGO", referencedColumnName = "PERSONCODE")
    @ManyToOne
    private Tcustperson personcodigo;
    @JoinColumns({
        @JoinColumn(name = "TIPOREGISTRO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "TIPOREGISTROCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;

    public Tarmcomerciantecupo() {
    }

    public Tarmcomerciantecupo(String ccomcupo) {
        this.ccomcupo = ccomcupo;
    }

    public String getCcomcupo() {
        return ccomcupo;
    }

    public void setCcomcupo(String ccomcupo) {
        this.ccomcupo = ccomcupo;
    }

    public BigDecimal getCupounidad() {
        return cupounidad;
    }

    public void setCupounidad(BigDecimal cupounidad) {
        this.cupounidad = cupounidad;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public Date getFecharegistro() {
        return fecharegistro;
    }

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

    public Tarmunidadtipo getTarmunidadtipo() {
        return tarmunidadtipo;
    }

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

    public Tcustperson getPersoncodigo() {
        return personcodigo;
    }

    public void setPersoncodigo(Tcustperson personcodigo) {
        this.personcodigo = personcodigo;
    }

    public Tgenecatalogdetail getTgenecatalogdetail() {
        return tgenecatalogdetail;
    }

    public void setTgenecatalogdetail(Tgenecatalogdetail tgenecatalogdetail) {
        this.tgenecatalogdetail = tgenecatalogdetail;
    }

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

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