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

/**
 *
 * @author developer2
 */
@Entity
@Table(name="COMACO.TGENEBALANCETYPEDETAIL")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tgenebalancetypedetail.findAll", query = "SELECT t FROM Tgenebalancetypedetail t"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByBalancetype", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.tgenebalancetypedetailPK.balancetype = :balancetype"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByBalancegroup", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.tgenebalancetypedetailPK.balancegroup = :balancegroup"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByRecordversion", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.recordversion = :recordversion"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByCommandbalance", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.commandbalance = :commandbalance"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByFieldname", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.fieldname = :fieldname"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByAccountingcode", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.accountingcode = :accountingcode"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByManagecache", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.managecache = :managecache"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByIsprovison", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.isprovison = :isprovison"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByCalculateprovision", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.calculateprovision = :calculateprovision"),
    @NamedQuery(name = "Tgenebalancetypedetail.findByBranchamong", query = "SELECT t FROM Tgenebalancetypedetail t WHERE t.branchamong = :branchamong")})
public class Tgenebalancetypedetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TgenebalancetypedetailPK tgenebalancetypedetailPK;
    @Column(name = "RECORDVERSION")
    private BigInteger recordversion;
    @Column(name = "COMMANDBALANCE")
    private String commandbalance;
    @Column(name = "FIELDNAME")
    private String fieldname;
    @Column(name = "ACCOUNTINGCODE")
    private String accountingcode;
    @Column(name = "MANAGECACHE")
    private String managecache;
    @Column(name = "ISPROVISON")
    private String isprovison;
    @Column(name = "CALCULATEPROVISION")
    private String calculateprovision;
    @Column(name = "BRANCHAMONG")
    private String branchamong;
    @JoinColumns({
        @JoinColumn(name = "BALANCETYPE", referencedColumnName = "BALANCETYPE", insertable = false, updatable = false),
        @JoinColumn(name = "BALANCEGROUP", referencedColumnName = "BALANCEGROUP", insertable = false, updatable = false)})
    @OneToOne(optional = false)
    private Tgenebalancetype tgenebalancetype;

    public Tgenebalancetypedetail() {
    }

    public Tgenebalancetypedetail(TgenebalancetypedetailPK tgenebalancetypedetailPK) {
        this.tgenebalancetypedetailPK = tgenebalancetypedetailPK;
    }

    public Tgenebalancetypedetail(String balancetype, String balancegroup) {
        this.tgenebalancetypedetailPK = new TgenebalancetypedetailPK(balancetype, balancegroup);
    }

    public TgenebalancetypedetailPK getTgenebalancetypedetailPK() {
        return tgenebalancetypedetailPK;
    }

    public void setTgenebalancetypedetailPK(TgenebalancetypedetailPK tgenebalancetypedetailPK) {
        this.tgenebalancetypedetailPK = tgenebalancetypedetailPK;
    }

    public BigInteger getRecordversion() {
        return recordversion;
    }

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

    public String getCommandbalance() {
        return commandbalance;
    }

    public void setCommandbalance(String commandbalance) {
        this.commandbalance = commandbalance;
    }

    public String getFieldname() {
        return fieldname;
    }

    public void setFieldname(String fieldname) {
        this.fieldname = fieldname;
    }

    public String getAccountingcode() {
        return accountingcode;
    }

    public void setAccountingcode(String accountingcode) {
        this.accountingcode = accountingcode;
    }

    public String getManagecache() {
        return managecache;
    }

    public void setManagecache(String managecache) {
        this.managecache = managecache;
    }

    public String getIsprovison() {
        return isprovison;
    }

    public void setIsprovison(String isprovison) {
        this.isprovison = isprovison;
    }

    public String getCalculateprovision() {
        return calculateprovision;
    }

    public void setCalculateprovision(String calculateprovision) {
        this.calculateprovision = calculateprovision;
    }

    public String getBranchamong() {
        return branchamong;
    }

    public void setBranchamong(String branchamong) {
        this.branchamong = branchamong;
    }

    public Tgenebalancetype getTgenebalancetype() {
        return tgenebalancetype;
    }

    public void setTgenebalancetype(Tgenebalancetype tgenebalancetype) {
        this.tgenebalancetype = tgenebalancetype;
    }

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

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