/*
 * 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 javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEACCOUNTSTATUS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgeneaccountstatus.findAll", query = "SELECT t FROM Tgeneaccountstatus t"),
    @NamedQuery(name = "Tgeneaccountstatus.findByModulecode", query = "SELECT t FROM Tgeneaccountstatus t WHERE t.tgeneaccountstatusPK.modulecode = :modulecode"),
    @NamedQuery(name = "Tgeneaccountstatus.findByStatuscode", query = "SELECT t FROM Tgeneaccountstatus t WHERE t.tgeneaccountstatusPK.statuscode = :statuscode"),
    @NamedQuery(name = "Tgeneaccountstatus.findByRecordversion", query = "SELECT t FROM Tgeneaccountstatus t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgeneaccountstatus.findByIsaccountstatus", query = "SELECT t FROM Tgeneaccountstatus t WHERE t.isaccountstatus = :isaccountstatus"),
    @NamedQuery(name = "Tgeneaccountstatus.findByDescription", query = "SELECT t FROM Tgeneaccountstatus t WHERE t.description = :description")})
public class Tgeneaccountstatus implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgeneaccountstatusPK tgeneaccountstatusPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "ISACCOUNTSTATUS")
    private String isaccountstatus;
    @Basic(optional = false)
    @Column(name = "DESCRIPTION")
    private String description;
    @JoinColumn(name = "MODULECODE", referencedColumnName = "MODULECODE", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Tgenemodule tgenemodule;

    public Tgeneaccountstatus() {
    }

    public Tgeneaccountstatus(TgeneaccountstatusPK tgeneaccountstatusPK) {
        this.tgeneaccountstatusPK = tgeneaccountstatusPK;
    }

    public Tgeneaccountstatus(TgeneaccountstatusPK tgeneaccountstatusPK, String description) {
        this.tgeneaccountstatusPK = tgeneaccountstatusPK;
        this.description = description;
    }

    public Tgeneaccountstatus(String modulecode, String statuscode) {
        this.tgeneaccountstatusPK = new TgeneaccountstatusPK(modulecode, statuscode);
    }

    public TgeneaccountstatusPK getTgeneaccountstatusPK() {
        return tgeneaccountstatusPK;
    }

    public void setTgeneaccountstatusPK(TgeneaccountstatusPK tgeneaccountstatusPK) {
        this.tgeneaccountstatusPK = tgeneaccountstatusPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getIsaccountstatus() {
        return isaccountstatus;
    }

    public void setIsaccountstatus(String isaccountstatus) {
        this.isaccountstatus = isaccountstatus;
    }

    public String getDescription() {
        return description;
    }

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

    public Tgenemodule getTgenemodule() {
        return tgenemodule;
    }

    public void setTgenemodule(Tgenemodule tgenemodule) {
        this.tgenemodule = tgenemodule;
    }

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

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