net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamAccountConfigTable.java Source code

Java tutorial

Introduction

Here is the source code for net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamAccountConfigTable.java

Source

// Description: Java7 in-memory RAM DbIO implementation for AccountConfig.

/*
 *   MSS Code Factory Accounting Business Application Model
 *
 *   Copyright (c) 2014 Mark Sobkow
 *   
 *   This program is available as free software under the GNU GPL v3, or
 *   under a commercial license from Mark Sobkow.  For commercial licensing
 *   details, please contact msobkow@sasktel.net.
 *   
 *   Under the terms of the GPL:
 *   
 *      This program is free software: you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation, either version 3 of the License, or
 *      (at your option) any later version.
 *     
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *     
 *      You should have received a copy of the GNU General Public License
 *      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *   
 *      This source code incorporates modified modules originally licensed
 *      under the Apache 2.0 license by MSS Code Factory including CFSecurity
 *      (net-sourceforge-msscodefactory-2.0-cfsecurity.xml),
 *      CFInternet (net-sourceforge-msscodefactory-2.0-cfinternet.xml), and
 *      CFCrm 2.0 (net-sourceforge-msscodefactory-2.0-cfcrm.xml), with all of the
 *      required models being available as part of the MSS Code Factory 1.11
 *      distribution source and install zips.
 *   
 *      You can download installations of MSS Code Factory 1.11 from
 *      http://msscodefactory.sourceforge.net/
 *   
 * ***********************************************************************
 *
 *   Code manufactured by MSS Code Factory
 */

package net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam;

import java.sql.*;
import java.util.*;
import net.sourceforge.msscodefactory.cflib.v1_11.CFLib.*;
import org.apache.commons.codec.binary.Base64;
import net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.*;
import net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.*;

/*
 *   CFAccRamAccountConfigTable in-memory RAM DbIO implementation
 *   for AccountConfig.
 */
public class CFAccRamAccountConfigTable implements ICFAccAccountConfigTable {
    private CFAccRamSchema schema;
    private Map<CFAccAccountConfigPKey, CFAccAccountConfigBuff> dictByPKey = new HashMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
    private SortedMap<CFAccAccountConfigByTenantIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>> dictByTenantIdx = new TreeMap<CFAccAccountConfigByTenantIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>>();
    private SortedMap<CFAccAccountConfigByDefCcyIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>> dictByDefCcyIdx = new TreeMap<CFAccAccountConfigByDefCcyIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>>();
    private SortedMap<CFAccAccountConfigByCustCtcLstIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>> dictByCustCtcLstIdx = new TreeMap<CFAccAccountConfigByCustCtcLstIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>>();
    private SortedMap<CFAccAccountConfigByEmpCtcLstIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>> dictByEmpCtcLstIdx = new TreeMap<CFAccAccountConfigByEmpCtcLstIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>>();
    private SortedMap<CFAccAccountConfigByVendCtcLstIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>> dictByVendCtcLstIdx = new TreeMap<CFAccAccountConfigByVendCtcLstIdxKey, SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>>();

    public CFAccRamAccountConfigTable(CFAccRamSchema argSchema) {
        schema = argSchema;
    }

    public void createAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) {
        CFAccAccountConfigPKey pkey = schema.getFactoryAccountConfig().newPKey();
        pkey.setRequiredTenantId(Buff.getRequiredTenantId());
        Buff.setRequiredTenantId(pkey.getRequiredTenantId());
        CFAccAccountConfigByTenantIdxKey keyTenantIdx = schema.getFactoryAccountConfig().newTenantIdxKey();
        keyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

        CFAccAccountConfigByDefCcyIdxKey keyDefCcyIdx = schema.getFactoryAccountConfig().newDefCcyIdxKey();
        keyDefCcyIdx.setRequiredDefaultCurrencyId(Buff.getRequiredDefaultCurrencyId());

        CFAccAccountConfigByCustCtcLstIdxKey keyCustCtcLstIdx = schema.getFactoryAccountConfig()
                .newCustCtcLstIdxKey();
        keyCustCtcLstIdx.setOptionalCustContactListTenantId(Buff.getOptionalCustContactListTenantId());
        keyCustCtcLstIdx.setOptionalCustContactListId(Buff.getOptionalCustContactListId());

        CFAccAccountConfigByEmpCtcLstIdxKey keyEmpCtcLstIdx = schema.getFactoryAccountConfig().newEmpCtcLstIdxKey();
        keyEmpCtcLstIdx.setOptionalEmpContactListTenantId(Buff.getOptionalEmpContactListTenantId());
        keyEmpCtcLstIdx.setOptionalEmpContactListId(Buff.getOptionalEmpContactListId());

        CFAccAccountConfigByVendCtcLstIdxKey keyVendCtcLstIdx = schema.getFactoryAccountConfig()
                .newVendCtcLstIdxKey();
        keyVendCtcLstIdx.setOptionalVendContactListTenantId(Buff.getOptionalVendContactListTenantId());
        keyVendCtcLstIdx.setOptionalVendContactListId(Buff.getOptionalVendContactListId());

        // Validate unique indexes

        if (dictByPKey.containsKey(pkey)) {
            throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createAccountConfig",
                    pkey);
        }

        // Validate foreign keys

        {
            boolean allNull = true;
            allNull = false;
            if (!allNull) {
                if (null == schema.getTableTenant().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
                    throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                            "createAccountConfig", "Container", "Tenant", "Tenant", null);
                }
            }
        }

        {
            boolean allNull = true;
            allNull = false;
            if (!allNull) {
                if (null == schema.getTableISOCurrency().readDerivedByIdIdx(Authorization,
                        Buff.getRequiredDefaultCurrencyId())) {
                    throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                            "createAccountConfig", "Lookup", "DefaultCurrency", "ISOCurrency", null);
                }
            }
        }

        // Proceed with adding the new record

        dictByPKey.put(pkey, Buff);

        SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictTenantIdx;
        if (dictByTenantIdx.containsKey(keyTenantIdx)) {
            subdictTenantIdx = dictByTenantIdx.get(keyTenantIdx);
        } else {
            subdictTenantIdx = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByTenantIdx.put(keyTenantIdx, subdictTenantIdx);
        }
        subdictTenantIdx.put(pkey, Buff);

        SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictDefCcyIdx;
        if (dictByDefCcyIdx.containsKey(keyDefCcyIdx)) {
            subdictDefCcyIdx = dictByDefCcyIdx.get(keyDefCcyIdx);
        } else {
            subdictDefCcyIdx = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByDefCcyIdx.put(keyDefCcyIdx, subdictDefCcyIdx);
        }
        subdictDefCcyIdx.put(pkey, Buff);

        SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictCustCtcLstIdx;
        if (dictByCustCtcLstIdx.containsKey(keyCustCtcLstIdx)) {
            subdictCustCtcLstIdx = dictByCustCtcLstIdx.get(keyCustCtcLstIdx);
        } else {
            subdictCustCtcLstIdx = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByCustCtcLstIdx.put(keyCustCtcLstIdx, subdictCustCtcLstIdx);
        }
        subdictCustCtcLstIdx.put(pkey, Buff);

        SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictEmpCtcLstIdx;
        if (dictByEmpCtcLstIdx.containsKey(keyEmpCtcLstIdx)) {
            subdictEmpCtcLstIdx = dictByEmpCtcLstIdx.get(keyEmpCtcLstIdx);
        } else {
            subdictEmpCtcLstIdx = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByEmpCtcLstIdx.put(keyEmpCtcLstIdx, subdictEmpCtcLstIdx);
        }
        subdictEmpCtcLstIdx.put(pkey, Buff);

        SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictVendCtcLstIdx;
        if (dictByVendCtcLstIdx.containsKey(keyVendCtcLstIdx)) {
            subdictVendCtcLstIdx = dictByVendCtcLstIdx.get(keyVendCtcLstIdx);
        } else {
            subdictVendCtcLstIdx = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByVendCtcLstIdx.put(keyVendCtcLstIdx, subdictVendCtcLstIdx);
        }
        subdictVendCtcLstIdx.put(pkey, Buff);

    }

    public CFAccAccountConfigBuff readDerived(CFAccAuthorization Authorization, CFAccAccountConfigPKey PKey) {
        final String S_ProcName = "CFAccRamAccountConfig.readDerived() ";
        CFAccAccountConfigPKey key = schema.getFactoryAccountConfig().newPKey();
        key.setRequiredTenantId(PKey.getRequiredTenantId());
        CFAccAccountConfigBuff buff;
        if (dictByPKey.containsKey(key)) {
            buff = dictByPKey.get(key);
        } else {
            buff = null;
        }
        return (buff);
    }

    public CFAccAccountConfigBuff lockDerived(CFAccAuthorization Authorization, CFAccAccountConfigPKey PKey) {
        final String S_ProcName = "CFAccRamAccountConfig.readDerived() ";
        CFAccAccountConfigPKey key = schema.getFactoryAccountConfig().newPKey();
        key.setRequiredTenantId(PKey.getRequiredTenantId());
        CFAccAccountConfigBuff buff;
        if (dictByPKey.containsKey(key)) {
            buff = dictByPKey.get(key);
        } else {
            buff = null;
        }
        return (buff);
    }

    public CFAccAccountConfigBuff[] readAllDerived(CFAccAuthorization Authorization) {
        final String S_ProcName = "CFAccRamAccountConfig.readAllDerived() ";
        CFAccAccountConfigBuff[] retList = new CFAccAccountConfigBuff[dictByPKey.values().size()];
        Iterator<CFAccAccountConfigBuff> iter = dictByPKey.values().iterator();
        int idx = 0;
        while (iter.hasNext()) {
            retList[idx++] = iter.next();
        }
        return (retList);
    }

    public CFAccAccountConfigBuff[] readDerivedByTenantIdx(CFAccAuthorization Authorization, long TenantId) {
        final String S_ProcName = "CFAccRamAccountConfig.readDerivedByTenantIdx() ";
        CFAccAccountConfigByTenantIdxKey key = schema.getFactoryAccountConfig().newTenantIdxKey();
        key.setRequiredTenantId(TenantId);

        CFAccAccountConfigBuff[] recArray;
        if (dictByTenantIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictTenantIdx = dictByTenantIdx.get(key);
            recArray = new CFAccAccountConfigBuff[subdictTenantIdx.size()];
            Iterator<CFAccAccountConfigBuff> iter = subdictTenantIdx.values().iterator();
            int idx = 0;
            while (iter.hasNext()) {
                recArray[idx++] = iter.next();
            }
        } else {
            recArray = new CFAccAccountConfigBuff[0];
        }
        return (recArray);
    }

    public CFAccAccountConfigBuff[] readDerivedByDefCcyIdx(CFAccAuthorization Authorization,
            short DefaultCurrencyId) {
        final String S_ProcName = "CFAccRamAccountConfig.readDerivedByDefCcyIdx() ";
        CFAccAccountConfigByDefCcyIdxKey key = schema.getFactoryAccountConfig().newDefCcyIdxKey();
        key.setRequiredDefaultCurrencyId(DefaultCurrencyId);

        CFAccAccountConfigBuff[] recArray;
        if (dictByDefCcyIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictDefCcyIdx = dictByDefCcyIdx.get(key);
            recArray = new CFAccAccountConfigBuff[subdictDefCcyIdx.size()];
            Iterator<CFAccAccountConfigBuff> iter = subdictDefCcyIdx.values().iterator();
            int idx = 0;
            while (iter.hasNext()) {
                recArray[idx++] = iter.next();
            }
        } else {
            recArray = new CFAccAccountConfigBuff[0];
        }
        return (recArray);
    }

    public CFAccAccountConfigBuff[] readDerivedByCustCtcLstIdx(CFAccAuthorization Authorization,
            Long CustContactListTenantId, Long CustContactListId) {
        final String S_ProcName = "CFAccRamAccountConfig.readDerivedByCustCtcLstIdx() ";
        CFAccAccountConfigByCustCtcLstIdxKey key = schema.getFactoryAccountConfig().newCustCtcLstIdxKey();
        key.setOptionalCustContactListTenantId(CustContactListTenantId);
        key.setOptionalCustContactListId(CustContactListId);

        CFAccAccountConfigBuff[] recArray;
        if (dictByCustCtcLstIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictCustCtcLstIdx = dictByCustCtcLstIdx
                    .get(key);
            recArray = new CFAccAccountConfigBuff[subdictCustCtcLstIdx.size()];
            Iterator<CFAccAccountConfigBuff> iter = subdictCustCtcLstIdx.values().iterator();
            int idx = 0;
            while (iter.hasNext()) {
                recArray[idx++] = iter.next();
            }
        } else {
            recArray = new CFAccAccountConfigBuff[0];
        }
        return (recArray);
    }

    public CFAccAccountConfigBuff[] readDerivedByEmpCtcLstIdx(CFAccAuthorization Authorization,
            Long EmpContactListTenantId, Long EmpContactListId) {
        final String S_ProcName = "CFAccRamAccountConfig.readDerivedByEmpCtcLstIdx() ";
        CFAccAccountConfigByEmpCtcLstIdxKey key = schema.getFactoryAccountConfig().newEmpCtcLstIdxKey();
        key.setOptionalEmpContactListTenantId(EmpContactListTenantId);
        key.setOptionalEmpContactListId(EmpContactListId);

        CFAccAccountConfigBuff[] recArray;
        if (dictByEmpCtcLstIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictEmpCtcLstIdx = dictByEmpCtcLstIdx
                    .get(key);
            recArray = new CFAccAccountConfigBuff[subdictEmpCtcLstIdx.size()];
            Iterator<CFAccAccountConfigBuff> iter = subdictEmpCtcLstIdx.values().iterator();
            int idx = 0;
            while (iter.hasNext()) {
                recArray[idx++] = iter.next();
            }
        } else {
            recArray = new CFAccAccountConfigBuff[0];
        }
        return (recArray);
    }

    public CFAccAccountConfigBuff[] readDerivedByVendCtcLstIdx(CFAccAuthorization Authorization,
            Long VendContactListTenantId, Long VendContactListId) {
        final String S_ProcName = "CFAccRamAccountConfig.readDerivedByVendCtcLstIdx() ";
        CFAccAccountConfigByVendCtcLstIdxKey key = schema.getFactoryAccountConfig().newVendCtcLstIdxKey();
        key.setOptionalVendContactListTenantId(VendContactListTenantId);
        key.setOptionalVendContactListId(VendContactListId);

        CFAccAccountConfigBuff[] recArray;
        if (dictByVendCtcLstIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictVendCtcLstIdx = dictByVendCtcLstIdx
                    .get(key);
            recArray = new CFAccAccountConfigBuff[subdictVendCtcLstIdx.size()];
            Iterator<CFAccAccountConfigBuff> iter = subdictVendCtcLstIdx.values().iterator();
            int idx = 0;
            while (iter.hasNext()) {
                recArray[idx++] = iter.next();
            }
        } else {
            recArray = new CFAccAccountConfigBuff[0];
        }
        return (recArray);
    }

    public CFAccAccountConfigBuff readDerivedByIdIdx(CFAccAuthorization Authorization, long TenantId) {
        final String S_ProcName = "CFAccRamAccountConfig.readDerivedByIdIdx() ";
        CFAccAccountConfigPKey key = schema.getFactoryAccountConfig().newPKey();
        key.setRequiredTenantId(TenantId);

        CFAccAccountConfigBuff buff;
        if (dictByPKey.containsKey(key)) {
            buff = dictByPKey.get(key);
        } else {
            buff = null;
        }
        return (buff);
    }

    public CFAccAccountConfigBuff readBuff(CFAccAuthorization Authorization, CFAccAccountConfigPKey PKey) {
        final String S_ProcName = "CFAccRamAccountConfig.readBuff() ";
        CFAccAccountConfigBuff buff = readDerived(Authorization, PKey);
        if ((buff != null) && (!buff.getClassCode().equals("ACFG"))) {
            buff = null;
        }
        return (buff);
    }

    public CFAccAccountConfigBuff lockBuff(CFAccAuthorization Authorization, CFAccAccountConfigPKey PKey) {
        final String S_ProcName = "CFAccRamAccountConfig.readBuff() ";
        CFAccAccountConfigBuff buff = readDerived(Authorization, PKey);
        if ((buff != null) && (!buff.getClassCode().equals("ACFG"))) {
            buff = null;
        }
        return (buff);
    }

    public CFAccAccountConfigBuff[] readAllBuff(CFAccAuthorization Authorization) {
        final String S_ProcName = "CFAccRamAccountConfig.readAllBuff() ";
        CFAccAccountConfigBuff buff;
        ArrayList<CFAccAccountConfigBuff> filteredList = new ArrayList<CFAccAccountConfigBuff>();
        CFAccAccountConfigBuff[] buffList = readAllDerived(Authorization);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ACFG")) {
                filteredList.add(buff);
            }
        }
        return (filteredList.toArray(new CFAccAccountConfigBuff[0]));
    }

    public CFAccAccountConfigBuff readBuffByIdIdx(CFAccAuthorization Authorization, long TenantId) {
        final String S_ProcName = "CFAccRamAccountConfig.readBuffByIdIdx() ";
        CFAccAccountConfigBuff buff = readDerivedByIdIdx(Authorization, TenantId);
        if ((buff != null) && buff.getClassCode().equals("ACFG")) {
            return ((CFAccAccountConfigBuff) buff);
        } else {
            return (null);
        }
    }

    public CFAccAccountConfigBuff[] readBuffByTenantIdx(CFAccAuthorization Authorization, long TenantId) {
        final String S_ProcName = "CFAccRamAccountConfig.readBuffByTenantIdx() ";
        CFAccAccountConfigBuff buff;
        ArrayList<CFAccAccountConfigBuff> filteredList = new ArrayList<CFAccAccountConfigBuff>();
        CFAccAccountConfigBuff[] buffList = readDerivedByTenantIdx(Authorization, TenantId);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ACFG")) {
                filteredList.add((CFAccAccountConfigBuff) buff);
            }
        }
        return (filteredList.toArray(new CFAccAccountConfigBuff[0]));
    }

    public CFAccAccountConfigBuff[] readBuffByDefCcyIdx(CFAccAuthorization Authorization, short DefaultCurrencyId) {
        final String S_ProcName = "CFAccRamAccountConfig.readBuffByDefCcyIdx() ";
        CFAccAccountConfigBuff buff;
        ArrayList<CFAccAccountConfigBuff> filteredList = new ArrayList<CFAccAccountConfigBuff>();
        CFAccAccountConfigBuff[] buffList = readDerivedByDefCcyIdx(Authorization, DefaultCurrencyId);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ACFG")) {
                filteredList.add((CFAccAccountConfigBuff) buff);
            }
        }
        return (filteredList.toArray(new CFAccAccountConfigBuff[0]));
    }

    public CFAccAccountConfigBuff[] readBuffByCustCtcLstIdx(CFAccAuthorization Authorization,
            Long CustContactListTenantId, Long CustContactListId) {
        final String S_ProcName = "CFAccRamAccountConfig.readBuffByCustCtcLstIdx() ";
        CFAccAccountConfigBuff buff;
        ArrayList<CFAccAccountConfigBuff> filteredList = new ArrayList<CFAccAccountConfigBuff>();
        CFAccAccountConfigBuff[] buffList = readDerivedByCustCtcLstIdx(Authorization, CustContactListTenantId,
                CustContactListId);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ACFG")) {
                filteredList.add((CFAccAccountConfigBuff) buff);
            }
        }
        return (filteredList.toArray(new CFAccAccountConfigBuff[0]));
    }

    public CFAccAccountConfigBuff[] readBuffByEmpCtcLstIdx(CFAccAuthorization Authorization,
            Long EmpContactListTenantId, Long EmpContactListId) {
        final String S_ProcName = "CFAccRamAccountConfig.readBuffByEmpCtcLstIdx() ";
        CFAccAccountConfigBuff buff;
        ArrayList<CFAccAccountConfigBuff> filteredList = new ArrayList<CFAccAccountConfigBuff>();
        CFAccAccountConfigBuff[] buffList = readDerivedByEmpCtcLstIdx(Authorization, EmpContactListTenantId,
                EmpContactListId);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ACFG")) {
                filteredList.add((CFAccAccountConfigBuff) buff);
            }
        }
        return (filteredList.toArray(new CFAccAccountConfigBuff[0]));
    }

    public CFAccAccountConfigBuff[] readBuffByVendCtcLstIdx(CFAccAuthorization Authorization,
            Long VendContactListTenantId, Long VendContactListId) {
        final String S_ProcName = "CFAccRamAccountConfig.readBuffByVendCtcLstIdx() ";
        CFAccAccountConfigBuff buff;
        ArrayList<CFAccAccountConfigBuff> filteredList = new ArrayList<CFAccAccountConfigBuff>();
        CFAccAccountConfigBuff[] buffList = readDerivedByVendCtcLstIdx(Authorization, VendContactListTenantId,
                VendContactListId);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ACFG")) {
                filteredList.add((CFAccAccountConfigBuff) buff);
            }
        }
        return (filteredList.toArray(new CFAccAccountConfigBuff[0]));
    }

    public void updateAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) {
        CFAccAccountConfigPKey pkey = schema.getFactoryAccountConfig().newPKey();
        pkey.setRequiredTenantId(Buff.getRequiredTenantId());
        CFAccAccountConfigBuff existing = dictByPKey.get(pkey);
        if (existing == null) {
            throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                    "updateAccountConfig", "Existing record not found", "AccountConfig", pkey);
        }
        if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
            throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                    "updateAccountConfig", pkey);
        }
        Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
        CFAccAccountConfigByTenantIdxKey existingKeyTenantIdx = schema.getFactoryAccountConfig().newTenantIdxKey();
        existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

        CFAccAccountConfigByTenantIdxKey newKeyTenantIdx = schema.getFactoryAccountConfig().newTenantIdxKey();
        newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

        CFAccAccountConfigByDefCcyIdxKey existingKeyDefCcyIdx = schema.getFactoryAccountConfig().newDefCcyIdxKey();
        existingKeyDefCcyIdx.setRequiredDefaultCurrencyId(existing.getRequiredDefaultCurrencyId());

        CFAccAccountConfigByDefCcyIdxKey newKeyDefCcyIdx = schema.getFactoryAccountConfig().newDefCcyIdxKey();
        newKeyDefCcyIdx.setRequiredDefaultCurrencyId(Buff.getRequiredDefaultCurrencyId());

        CFAccAccountConfigByCustCtcLstIdxKey existingKeyCustCtcLstIdx = schema.getFactoryAccountConfig()
                .newCustCtcLstIdxKey();
        existingKeyCustCtcLstIdx.setOptionalCustContactListTenantId(existing.getOptionalCustContactListTenantId());
        existingKeyCustCtcLstIdx.setOptionalCustContactListId(existing.getOptionalCustContactListId());

        CFAccAccountConfigByCustCtcLstIdxKey newKeyCustCtcLstIdx = schema.getFactoryAccountConfig()
                .newCustCtcLstIdxKey();
        newKeyCustCtcLstIdx.setOptionalCustContactListTenantId(Buff.getOptionalCustContactListTenantId());
        newKeyCustCtcLstIdx.setOptionalCustContactListId(Buff.getOptionalCustContactListId());

        CFAccAccountConfigByEmpCtcLstIdxKey existingKeyEmpCtcLstIdx = schema.getFactoryAccountConfig()
                .newEmpCtcLstIdxKey();
        existingKeyEmpCtcLstIdx.setOptionalEmpContactListTenantId(existing.getOptionalEmpContactListTenantId());
        existingKeyEmpCtcLstIdx.setOptionalEmpContactListId(existing.getOptionalEmpContactListId());

        CFAccAccountConfigByEmpCtcLstIdxKey newKeyEmpCtcLstIdx = schema.getFactoryAccountConfig()
                .newEmpCtcLstIdxKey();
        newKeyEmpCtcLstIdx.setOptionalEmpContactListTenantId(Buff.getOptionalEmpContactListTenantId());
        newKeyEmpCtcLstIdx.setOptionalEmpContactListId(Buff.getOptionalEmpContactListId());

        CFAccAccountConfigByVendCtcLstIdxKey existingKeyVendCtcLstIdx = schema.getFactoryAccountConfig()
                .newVendCtcLstIdxKey();
        existingKeyVendCtcLstIdx.setOptionalVendContactListTenantId(existing.getOptionalVendContactListTenantId());
        existingKeyVendCtcLstIdx.setOptionalVendContactListId(existing.getOptionalVendContactListId());

        CFAccAccountConfigByVendCtcLstIdxKey newKeyVendCtcLstIdx = schema.getFactoryAccountConfig()
                .newVendCtcLstIdxKey();
        newKeyVendCtcLstIdx.setOptionalVendContactListTenantId(Buff.getOptionalVendContactListTenantId());
        newKeyVendCtcLstIdx.setOptionalVendContactListId(Buff.getOptionalVendContactListId());

        // Check unique indexes

        // Validate foreign keys

        {
            boolean allNull = true;

            if (allNull) {
                if (null == schema.getTableTenant().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
                    throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                            "updateAccountConfig", "Container", "Tenant", "Tenant", null);
                }
            }
        }

        {
            boolean allNull = true;

            if (allNull) {
                if (null == schema.getTableISOCurrency().readDerivedByIdIdx(Authorization,
                        Buff.getRequiredDefaultCurrencyId())) {
                    throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                            "updateAccountConfig", "Lookup", "DefaultCurrency", "ISOCurrency", null);
                }
            }
        }

        // Update is valid

        SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdict;

        dictByPKey.remove(pkey);
        dictByPKey.put(pkey, Buff);

        subdict = dictByTenantIdx.get(existingKeyTenantIdx);
        if (subdict != null) {
            subdict.remove(pkey);
        }
        if (dictByTenantIdx.containsKey(newKeyTenantIdx)) {
            subdict = dictByTenantIdx.get(newKeyTenantIdx);
        } else {
            subdict = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByTenantIdx.put(newKeyTenantIdx, subdict);
        }
        subdict.put(pkey, Buff);

        subdict = dictByDefCcyIdx.get(existingKeyDefCcyIdx);
        if (subdict != null) {
            subdict.remove(pkey);
        }
        if (dictByDefCcyIdx.containsKey(newKeyDefCcyIdx)) {
            subdict = dictByDefCcyIdx.get(newKeyDefCcyIdx);
        } else {
            subdict = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByDefCcyIdx.put(newKeyDefCcyIdx, subdict);
        }
        subdict.put(pkey, Buff);

        subdict = dictByCustCtcLstIdx.get(existingKeyCustCtcLstIdx);
        if (subdict != null) {
            subdict.remove(pkey);
        }
        if (dictByCustCtcLstIdx.containsKey(newKeyCustCtcLstIdx)) {
            subdict = dictByCustCtcLstIdx.get(newKeyCustCtcLstIdx);
        } else {
            subdict = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByCustCtcLstIdx.put(newKeyCustCtcLstIdx, subdict);
        }
        subdict.put(pkey, Buff);

        subdict = dictByEmpCtcLstIdx.get(existingKeyEmpCtcLstIdx);
        if (subdict != null) {
            subdict.remove(pkey);
        }
        if (dictByEmpCtcLstIdx.containsKey(newKeyEmpCtcLstIdx)) {
            subdict = dictByEmpCtcLstIdx.get(newKeyEmpCtcLstIdx);
        } else {
            subdict = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByEmpCtcLstIdx.put(newKeyEmpCtcLstIdx, subdict);
        }
        subdict.put(pkey, Buff);

        subdict = dictByVendCtcLstIdx.get(existingKeyVendCtcLstIdx);
        if (subdict != null) {
            subdict.remove(pkey);
        }
        if (dictByVendCtcLstIdx.containsKey(newKeyVendCtcLstIdx)) {
            subdict = dictByVendCtcLstIdx.get(newKeyVendCtcLstIdx);
        } else {
            subdict = new TreeMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff>();
            dictByVendCtcLstIdx.put(newKeyVendCtcLstIdx, subdict);
        }
        subdict.put(pkey, Buff);

    }

    public void deleteAccountConfig(CFAccAuthorization Authorization, CFAccAccountConfigBuff Buff) {
        final String S_ProcName = "CFAccRamAccountConfigTable.deleteAccountConfig() ";
        CFAccAccountConfigPKey pkey = schema.getFactoryAccountConfig().newPKey();
        pkey.setRequiredTenantId(Buff.getRequiredTenantId());
        CFAccAccountConfigBuff existing = dictByPKey.get(pkey);
        if (existing == null) {
            return;
        }
        if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
            throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                    "deleteAccountConfig", pkey);
        }
        CFAccAccountConfigByTenantIdxKey keyTenantIdx = schema.getFactoryAccountConfig().newTenantIdxKey();
        keyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

        CFAccAccountConfigByDefCcyIdxKey keyDefCcyIdx = schema.getFactoryAccountConfig().newDefCcyIdxKey();
        keyDefCcyIdx.setRequiredDefaultCurrencyId(existing.getRequiredDefaultCurrencyId());

        CFAccAccountConfigByCustCtcLstIdxKey keyCustCtcLstIdx = schema.getFactoryAccountConfig()
                .newCustCtcLstIdxKey();
        keyCustCtcLstIdx.setOptionalCustContactListTenantId(existing.getOptionalCustContactListTenantId());
        keyCustCtcLstIdx.setOptionalCustContactListId(existing.getOptionalCustContactListId());

        CFAccAccountConfigByEmpCtcLstIdxKey keyEmpCtcLstIdx = schema.getFactoryAccountConfig().newEmpCtcLstIdxKey();
        keyEmpCtcLstIdx.setOptionalEmpContactListTenantId(existing.getOptionalEmpContactListTenantId());
        keyEmpCtcLstIdx.setOptionalEmpContactListId(existing.getOptionalEmpContactListId());

        CFAccAccountConfigByVendCtcLstIdxKey keyVendCtcLstIdx = schema.getFactoryAccountConfig()
                .newVendCtcLstIdxKey();
        keyVendCtcLstIdx.setOptionalVendContactListTenantId(existing.getOptionalVendContactListTenantId());
        keyVendCtcLstIdx.setOptionalVendContactListId(existing.getOptionalVendContactListId());

        // Validate reverse foreign keys

        // Delete is valid

        SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdict;

        dictByPKey.remove(pkey);

        subdict = dictByTenantIdx.get(keyTenantIdx);
        subdict.remove(pkey);

        subdict = dictByDefCcyIdx.get(keyDefCcyIdx);
        subdict.remove(pkey);

        subdict = dictByCustCtcLstIdx.get(keyCustCtcLstIdx);
        subdict.remove(pkey);

        subdict = dictByEmpCtcLstIdx.get(keyEmpCtcLstIdx);
        subdict.remove(pkey);

        subdict = dictByVendCtcLstIdx.get(keyVendCtcLstIdx);
        subdict.remove(pkey);

    }

    public void deleteAccountConfigByIdIdx(CFAccAuthorization Authorization, long argTenantId) {
        CFAccAccountConfigPKey key = schema.getFactoryAccountConfig().newPKey();
        key.setRequiredTenantId(argTenantId);
        deleteAccountConfigByIdIdx(Authorization, key);
    }

    public void deleteAccountConfigByIdIdx(CFAccAuthorization Authorization, CFAccAccountConfigPKey argKey) {
        CFAccAccountConfigBuff cur;
        LinkedList<CFAccAccountConfigBuff> matchSet = new LinkedList<CFAccAccountConfigBuff>();
        Iterator<CFAccAccountConfigBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFAccAccountConfigBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteAccountConfig(Authorization, cur);
        }
    }

    public void deleteAccountConfigByTenantIdx(CFAccAuthorization Authorization, long argTenantId) {
        CFAccAccountConfigByTenantIdxKey key = schema.getFactoryAccountConfig().newTenantIdxKey();
        key.setRequiredTenantId(argTenantId);
        deleteAccountConfigByTenantIdx(Authorization, key);
    }

    public void deleteAccountConfigByTenantIdx(CFAccAuthorization Authorization,
            CFAccAccountConfigByTenantIdxKey argKey) {
        CFAccAccountConfigBuff cur;
        LinkedList<CFAccAccountConfigBuff> matchSet = new LinkedList<CFAccAccountConfigBuff>();
        Iterator<CFAccAccountConfigBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFAccAccountConfigBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteAccountConfig(Authorization, cur);
        }
    }

    public void deleteAccountConfigByDefCcyIdx(CFAccAuthorization Authorization, short argDefaultCurrencyId) {
        CFAccAccountConfigByDefCcyIdxKey key = schema.getFactoryAccountConfig().newDefCcyIdxKey();
        key.setRequiredDefaultCurrencyId(argDefaultCurrencyId);
        deleteAccountConfigByDefCcyIdx(Authorization, key);
    }

    public void deleteAccountConfigByDefCcyIdx(CFAccAuthorization Authorization,
            CFAccAccountConfigByDefCcyIdxKey argKey) {
        CFAccAccountConfigBuff cur;
        LinkedList<CFAccAccountConfigBuff> matchSet = new LinkedList<CFAccAccountConfigBuff>();
        Iterator<CFAccAccountConfigBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFAccAccountConfigBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteAccountConfig(Authorization, cur);
        }
    }

    public void deleteAccountConfigByCustCtcLstIdx(CFAccAuthorization Authorization,
            Long argCustContactListTenantId, Long argCustContactListId) {
        CFAccAccountConfigByCustCtcLstIdxKey key = schema.getFactoryAccountConfig().newCustCtcLstIdxKey();
        key.setOptionalCustContactListTenantId(argCustContactListTenantId);
        key.setOptionalCustContactListId(argCustContactListId);
        deleteAccountConfigByCustCtcLstIdx(Authorization, key);
    }

    public void deleteAccountConfigByCustCtcLstIdx(CFAccAuthorization Authorization,
            CFAccAccountConfigByCustCtcLstIdxKey argKey) {
        CFAccAccountConfigBuff cur;
        LinkedList<CFAccAccountConfigBuff> matchSet = new LinkedList<CFAccAccountConfigBuff>();
        Iterator<CFAccAccountConfigBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFAccAccountConfigBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteAccountConfig(Authorization, cur);
        }
    }

    public void deleteAccountConfigByEmpCtcLstIdx(CFAccAuthorization Authorization, Long argEmpContactListTenantId,
            Long argEmpContactListId) {
        CFAccAccountConfigByEmpCtcLstIdxKey key = schema.getFactoryAccountConfig().newEmpCtcLstIdxKey();
        key.setOptionalEmpContactListTenantId(argEmpContactListTenantId);
        key.setOptionalEmpContactListId(argEmpContactListId);
        deleteAccountConfigByEmpCtcLstIdx(Authorization, key);
    }

    public void deleteAccountConfigByEmpCtcLstIdx(CFAccAuthorization Authorization,
            CFAccAccountConfigByEmpCtcLstIdxKey argKey) {
        CFAccAccountConfigBuff cur;
        LinkedList<CFAccAccountConfigBuff> matchSet = new LinkedList<CFAccAccountConfigBuff>();
        Iterator<CFAccAccountConfigBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFAccAccountConfigBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteAccountConfig(Authorization, cur);
        }
    }

    public void deleteAccountConfigByVendCtcLstIdx(CFAccAuthorization Authorization,
            Long argVendContactListTenantId, Long argVendContactListId) {
        CFAccAccountConfigByVendCtcLstIdxKey key = schema.getFactoryAccountConfig().newVendCtcLstIdxKey();
        key.setOptionalVendContactListTenantId(argVendContactListTenantId);
        key.setOptionalVendContactListId(argVendContactListId);
        deleteAccountConfigByVendCtcLstIdx(Authorization, key);
    }

    public void deleteAccountConfigByVendCtcLstIdx(CFAccAuthorization Authorization,
            CFAccAccountConfigByVendCtcLstIdxKey argKey) {
        CFAccAccountConfigBuff cur;
        LinkedList<CFAccAccountConfigBuff> matchSet = new LinkedList<CFAccAccountConfigBuff>();
        Iterator<CFAccAccountConfigBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFAccAccountConfigBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteAccountConfig(Authorization, cur);
        }
    }

    public CFAccCursor openAccountConfigCursorAll(CFAccAuthorization Authorization) {
        CFAccCursor cursor = new CFAccRamAccountConfigCursor(Authorization, schema, dictByPKey.values());
        return (cursor);
    }

    public CFAccCursor openAccountConfigCursorByTenantIdx(CFAccAuthorization Authorization, long TenantId) {
        CFAccCursor cursor;
        CFAccAccountConfigByTenantIdxKey key = schema.getFactoryAccountConfig().newTenantIdxKey();
        key.setRequiredTenantId(TenantId);

        if (dictByTenantIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictTenantIdx = dictByTenantIdx.get(key);
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema, subdictTenantIdx.values());
        } else {
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema,
                    new ArrayList<CFAccAccountConfigBuff>());
        }
        return (cursor);
    }

    public CFAccCursor openAccountConfigCursorByDefCcyIdx(CFAccAuthorization Authorization,
            short DefaultCurrencyId) {
        CFAccCursor cursor;
        CFAccAccountConfigByDefCcyIdxKey key = schema.getFactoryAccountConfig().newDefCcyIdxKey();
        key.setRequiredDefaultCurrencyId(DefaultCurrencyId);

        if (dictByDefCcyIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictDefCcyIdx = dictByDefCcyIdx.get(key);
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema, subdictDefCcyIdx.values());
        } else {
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema,
                    new ArrayList<CFAccAccountConfigBuff>());
        }
        return (cursor);
    }

    public CFAccCursor openAccountConfigCursorByCustCtcLstIdx(CFAccAuthorization Authorization,
            Long CustContactListTenantId, Long CustContactListId) {
        CFAccCursor cursor;
        CFAccAccountConfigByCustCtcLstIdxKey key = schema.getFactoryAccountConfig().newCustCtcLstIdxKey();
        key.setOptionalCustContactListTenantId(CustContactListTenantId);
        key.setOptionalCustContactListId(CustContactListId);

        if (dictByCustCtcLstIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictCustCtcLstIdx = dictByCustCtcLstIdx
                    .get(key);
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema, subdictCustCtcLstIdx.values());
        } else {
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema,
                    new ArrayList<CFAccAccountConfigBuff>());
        }
        return (cursor);
    }

    public CFAccCursor openAccountConfigCursorByEmpCtcLstIdx(CFAccAuthorization Authorization,
            Long EmpContactListTenantId, Long EmpContactListId) {
        CFAccCursor cursor;
        CFAccAccountConfigByEmpCtcLstIdxKey key = schema.getFactoryAccountConfig().newEmpCtcLstIdxKey();
        key.setOptionalEmpContactListTenantId(EmpContactListTenantId);
        key.setOptionalEmpContactListId(EmpContactListId);

        if (dictByEmpCtcLstIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictEmpCtcLstIdx = dictByEmpCtcLstIdx
                    .get(key);
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema, subdictEmpCtcLstIdx.values());
        } else {
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema,
                    new ArrayList<CFAccAccountConfigBuff>());
        }
        return (cursor);
    }

    public CFAccCursor openAccountConfigCursorByVendCtcLstIdx(CFAccAuthorization Authorization,
            Long VendContactListTenantId, Long VendContactListId) {
        CFAccCursor cursor;
        CFAccAccountConfigByVendCtcLstIdxKey key = schema.getFactoryAccountConfig().newVendCtcLstIdxKey();
        key.setOptionalVendContactListTenantId(VendContactListTenantId);
        key.setOptionalVendContactListId(VendContactListId);

        if (dictByVendCtcLstIdx.containsKey(key)) {
            SortedMap<CFAccAccountConfigPKey, CFAccAccountConfigBuff> subdictVendCtcLstIdx = dictByVendCtcLstIdx
                    .get(key);
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema, subdictVendCtcLstIdx.values());
        } else {
            cursor = new CFAccRamAccountConfigCursor(Authorization, schema,
                    new ArrayList<CFAccAccountConfigBuff>());
        }
        return (cursor);
    }

    public void closeAccountConfigCursor(CFAccCursor Cursor) {
        // Cursor.DataReader.Close();
    }

    public CFAccAccountConfigBuff nextAccountConfigCursor(CFAccCursor Cursor) {
        CFAccRamAccountConfigCursor cursor = (CFAccRamAccountConfigCursor) Cursor;
        CFAccAccountConfigBuff rec = cursor.getCursor().next();
        cursor.setRowIdx(cursor.getRowIdx() + 1);
        return (rec);
    }

    public CFAccAccountConfigBuff prevAccountConfigCursor(CFAccCursor Cursor) {
        int targetRowIdx = (Cursor.getRowIdx() > 1) ? Cursor.getRowIdx() - 1 : 1;
        CFAccAccountConfigBuff rec = null;
        if (Cursor.getRowIdx() >= targetRowIdx) {
            Cursor.reset();
        }
        while (Cursor.getRowIdx() < targetRowIdx) {
            rec = nextAccountConfigCursor(Cursor);
        }
        return (rec);
    }

    public CFAccAccountConfigBuff firstAccountConfigCursor(CFAccCursor Cursor) {
        int targetRowIdx = 1;
        CFAccAccountConfigBuff rec = null;
        Cursor.reset();
        while (Cursor.getRowIdx() < targetRowIdx) {
            rec = nextAccountConfigCursor(Cursor);
        }
        return (rec);
    }

    public CFAccAccountConfigBuff lastAccountConfigCursor(CFAccCursor Cursor) {
        throw CFLib.getDefaultExceptionFactory().newNotImplementedYetException(getClass(),
                "lastAccountConfigCursor");
    }

    public CFAccAccountConfigBuff nthAccountConfigCursor(CFAccCursor Cursor, int Idx) {
        int targetRowIdx = Idx;
        CFAccAccountConfigBuff rec = null;
        if (Cursor.getRowIdx() >= targetRowIdx) {
            Cursor.reset();
        }
        while (Cursor.getRowIdx() < targetRowIdx) {
            rec = nextAccountConfigCursor(Cursor);
        }
        return (rec);
    }

    public void releasePreparedStatements() {
    }
}