/*
 * 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.TARMTOTALPERSONA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tarmtotalpersona.findAll", query = "SELECT t FROM Tarmtotalpersona t"),
    @NamedQuery(name = "Tarmtotalpersona.findByCtotal", query = "SELECT t FROM Tarmtotalpersona t WHERE t.ctotal = :ctotal"),
    @NamedQuery(name = "Tarmtotalpersona.findByTotal", query = "SELECT t FROM Tarmtotalpersona t WHERE t.total = :total"),
    @NamedQuery(name = "Tarmtotalpersona.findBySaldoanterior", query = "SELECT t FROM Tarmtotalpersona t WHERE t.saldoanterior = :saldoanterior"),
    @NamedQuery(name = "Tarmtotalpersona.findByFecha", query = "SELECT t FROM Tarmtotalpersona t WHERE t.fecha = :fecha"),
    @NamedQuery(name = "Tarmtotalpersona.findByRecordversion", query = "SELECT t FROM Tarmtotalpersona t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tarmtotalpersona.findByCantidadmovimiento", query = "SELECT t FROM Tarmtotalpersona t WHERE t.cantidadmovimiento = :cantidadmovimiento")})
public class Tarmtotalpersona implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CTOTAL")
    private String ctotal;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "TOTAL")
    private BigDecimal total;
    @Column(name = "SALDOANTERIOR")
    private BigDecimal saldoanterior;
    @Column(name = "FECHA")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "CANTIDADMOVIMIENTO")
    private BigDecimal cantidadmovimiento;
    @JoinColumn(name = "CARMA", referencedColumnName = "CARMA")
    @ManyToOne
    private Tarmarmas carma;
    @JoinColumn(name = "CMOVIMIENTO", referencedColumnName = "CMOVIMIENTO")
    @ManyToOne
    private Tarmmovimientoarmas cmovimiento;
    @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 = "INGRESOEGRESO", referencedColumnName = "CATALOG"),
        @JoinColumn(name = "INGRESOEGRESOCODIGO", referencedColumnName = "CATALOGCODE")})
    @ManyToOne
    private Tgenecatalogdetail tgenecatalogdetail;

    public Tarmtotalpersona() {
    }

    public Tarmtotalpersona(String ctotal) {
        this.ctotal = ctotal;
    }

    public Tarmtotalpersona(String ctotal, BigDecimal total) {
        this.ctotal = ctotal;
        this.total = total;
    }

    public String getCtotal() {
        return ctotal;
    }

    public void setCtotal(String ctotal) {
        this.ctotal = ctotal;
    }

    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    public BigDecimal getSaldoanterior() {
        return saldoanterior;
    }

    public void setSaldoanterior(BigDecimal saldoanterior) {
        this.saldoanterior = saldoanterior;
    }

    public Date getFecha() {
        return fecha;
    }

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

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public BigDecimal getCantidadmovimiento() {
        return cantidadmovimiento;
    }

    public void setCantidadmovimiento(BigDecimal cantidadmovimiento) {
        this.cantidadmovimiento = cantidadmovimiento;
    }

    public Tarmarmas getCarma() {
        return carma;
    }

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

    public Tarmmovimientoarmas getCmovimiento() {
        return cmovimiento;
    }

    public void setCmovimiento(Tarmmovimientoarmas cmovimiento) {
        this.cmovimiento = cmovimiento;
    }

    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 += (ctotal != null ? ctotal.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 Tarmtotalpersona)) {
            return false;
        }
        Tarmtotalpersona other = (Tarmtotalpersona) object;
        if ((this.ctotal == null && other.ctotal != null) || (this.ctotal != null && !this.ctotal.equals(other.ctotal))) {
            return false;
        }
        return true;
    }

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