/*
 * 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.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
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.TARMCOME_TIPO_TRANSACCION")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TarmcomeTipoTransaccion.findAll", query = "SELECT t FROM TarmcomeTipoTransaccion t"),
    @NamedQuery(name = "TarmcomeTipoTransaccion.findByCottrCodigo", query = "SELECT t FROM TarmcomeTipoTransaccion t WHERE t.cottrCodigo = :cottrCodigo"),
    @NamedQuery(name = "TarmcomeTipoTransaccion.findByCottrNombre", query = "SELECT t FROM TarmcomeTipoTransaccion t WHERE t.cottrNombre = :cottrNombre"),
    @NamedQuery(name = "TarmcomeTipoTransaccion.findByCottrSigno", query = "SELECT t FROM TarmcomeTipoTransaccion t WHERE t.cottrSigno = :cottrSigno")})
public class TarmcomeTipoTransaccion implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "COTTR_CODIGO")
    private String cottrCodigo;
    @Basic(optional = false)
    @Column(name = "COTTR_NOMBRE")
    private String cottrNombre;
    @Basic(optional = false)
    @Column(name = "COTTR_SIGNO")
    private BigInteger cottrSigno;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cottrCodigo")
    private Collection<TarmcomeCabeceraTransaccion> tarmcomeCabeceraTransaccionCollection;

    public TarmcomeTipoTransaccion() {
    }

    public TarmcomeTipoTransaccion(String cottrCodigo) {
        this.cottrCodigo = cottrCodigo;
    }

    public TarmcomeTipoTransaccion(String cottrCodigo, String cottrNombre, BigInteger cottrSigno) {
        this.cottrCodigo = cottrCodigo;
        this.cottrNombre = cottrNombre;
        this.cottrSigno = cottrSigno;
    }

    public String getCottrCodigo() {
        return cottrCodigo;
    }

    public void setCottrCodigo(String cottrCodigo) {
        this.cottrCodigo = cottrCodigo;
    }

    public String getCottrNombre() {
        return cottrNombre;
    }

    public void setCottrNombre(String cottrNombre) {
        this.cottrNombre = cottrNombre;
    }

    public BigInteger getCottrSigno() {
        return cottrSigno;
    }

    public void setCottrSigno(BigInteger cottrSigno) {
        this.cottrSigno = cottrSigno;
    }

    @XmlTransient
    public Collection<TarmcomeCabeceraTransaccion> getTarmcomeCabeceraTransaccionCollection() {
        return tarmcomeCabeceraTransaccionCollection;
    }

    public void setTarmcomeCabeceraTransaccionCollection(Collection<TarmcomeCabeceraTransaccion> tarmcomeCabeceraTransaccionCollection) {
        this.tarmcomeCabeceraTransaccionCollection = tarmcomeCabeceraTransaccionCollection;
    }

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

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