/*
 * 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.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.TCUSTBALANCEACCOLEVEL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tcustbalanceaccolevel.findAll", query = "SELECT t FROM Tcustbalanceaccolevel t"),
    @NamedQuery(name = "Tcustbalanceaccolevel.findByAccolevelcode", query = "SELECT t FROM Tcustbalanceaccolevel t WHERE t.accolevelcode = :accolevelcode"),
    @NamedQuery(name = "Tcustbalanceaccolevel.findByDescription", query = "SELECT t FROM Tcustbalanceaccolevel t WHERE t.description = :description"),
    @NamedQuery(name = "Tcustbalanceaccolevel.findByRecordversion", query = "SELECT t FROM Tcustbalanceaccolevel t WHERE t.recordversion = :recordversion")})
public class Tcustbalanceaccolevel implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ACCOLEVELCODE")
    private Short accolevelcode;
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @OneToMany(mappedBy = "accolevelcode")
    private Collection<Tcustbalanceaccount> tcustbalanceaccountCollection;

    public Tcustbalanceaccolevel() {
    }

    public Tcustbalanceaccolevel(Short accolevelcode) {
        this.accolevelcode = accolevelcode;
    }

    public Short getAccolevelcode() {
        return accolevelcode;
    }

    public void setAccolevelcode(Short accolevelcode) {
        this.accolevelcode = accolevelcode;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    @XmlTransient
    public Collection<Tcustbalanceaccount> getTcustbalanceaccountCollection() {
        return tcustbalanceaccountCollection;
    }

    public void setTcustbalanceaccountCollection(Collection<Tcustbalanceaccount> tcustbalanceaccountCollection) {
        this.tcustbalanceaccountCollection = tcustbalanceaccountCollection;
    }

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

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