/*
 * 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.TGENECREDITTYPE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenecredittype.findAll", query = "SELECT t FROM Tgenecredittype t"),
    @NamedQuery(name = "Tgenecredittype.findByCredittypecode", query = "SELECT t FROM Tgenecredittype t WHERE t.credittypecode = :credittypecode"),
    @NamedQuery(name = "Tgenecredittype.findByRecordversion", query = "SELECT t FROM Tgenecredittype t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenecredittype.findByDescription", query = "SELECT t FROM Tgenecredittype t WHERE t.description = :description"),
    @NamedQuery(name = "Tgenecredittype.findByGracedays", query = "SELECT t FROM Tgenecredittype t WHERE t.gracedays = :gracedays"),
    @NamedQuery(name = "Tgenecredittype.findByCreditgracedays", query = "SELECT t FROM Tgenecredittype t WHERE t.creditgracedays = :creditgracedays")})
public class Tgenecredittype implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CREDITTYPECODE")
    private String credittypecode;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "DESCRIPTION")
    private String description;
    @Column(name = "GRACEDAYS")
    private Short gracedays;
    @Column(name = "CREDITGRACEDAYS")
    private Short creditgracedays;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tgenecredittype")
    private Collection<Tgenecredittypedesc> tgenecredittypedescCollection;

    public Tgenecredittype() {
    }

    public Tgenecredittype(String credittypecode) {
        this.credittypecode = credittypecode;
    }

    public String getCredittypecode() {
        return credittypecode;
    }

    public void setCredittypecode(String credittypecode) {
        this.credittypecode = credittypecode;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getDescription() {
        return description;
    }

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

    public Short getGracedays() {
        return gracedays;
    }

    public void setGracedays(Short gracedays) {
        this.gracedays = gracedays;
    }

    public Short getCreditgracedays() {
        return creditgracedays;
    }

    public void setCreditgracedays(Short creditgracedays) {
        this.creditgracedays = creditgracedays;
    }

    @XmlTransient
    public Collection<Tgenecredittypedesc> getTgenecredittypedescCollection() {
        return tgenecredittypedescCollection;
    }

    public void setTgenecredittypedescCollection(Collection<Tgenecredittypedesc> tgenecredittypedescCollection) {
        this.tgenecredittypedescCollection = tgenecredittypedescCollection;
    }

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

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