net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamISOCountryLanguageTable.java Source code

Java tutorial

Introduction

Here is the source code for net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.CFSecurityRamISOCountryLanguageTable.java

Source

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

/*
 *   CF Security Core Implementation
 *
 *   Copyright (c) 2010-2014 Mark Sobkow
 *   
 *      Licensed under the Apache License, Version 2.0 (the "License");
 *      you may not use this file except in compliance with the License.
 *      You may obtain a copy of the License at
 *   
 *          http://www.apache.org/licenses/LICENSE-2.0
 *   
 *      Unless required by applicable law or agreed to in writing, software
 *      distributed under the License is distributed on an "AS IS" BASIS,
 *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *      See the License for the specific language governing permissions and
 *      limitations under the License.
 *   
 * ***********************************************************************
 *
 *   Code manufactured by MSS Code Factory
 */

package net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam;

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.cfsecurity.v2_0.CFSecurity.*;
import net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurityRam.*;

/*
 *   CFSecurityRamISOCountryLanguageTable in-memory RAM DbIO implementation
 *   for ISOCountryLanguage.
 */
public class CFSecurityRamISOCountryLanguageTable implements ICFSecurityISOCountryLanguageTable {
    private CFSecurityRamSchema schema;
    private Map<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff> dictByPKey = new HashMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>();
    private SortedMap<CFSecurityISOCountryLanguageByCountryIdxKey, SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>> dictByCountryIdx = new TreeMap<CFSecurityISOCountryLanguageByCountryIdxKey, SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>>();
    private SortedMap<CFSecurityISOCountryLanguageByLanguageIdxKey, SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>> dictByLanguageIdx = new TreeMap<CFSecurityISOCountryLanguageByLanguageIdxKey, SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>>();

    public CFSecurityRamISOCountryLanguageTable(CFSecurityRamSchema argSchema) {
        schema = argSchema;
    }

    public void createISOCountryLanguage(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguageBuff Buff) {
        CFSecurityISOCountryLanguagePKey pkey = schema.getFactoryISOCountryLanguage().newPKey();
        pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId());
        pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());
        Buff.setRequiredISOCountryId(pkey.getRequiredISOCountryId());
        Buff.setRequiredISOLanguageId(pkey.getRequiredISOLanguageId());
        CFSecurityISOCountryLanguageByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryLanguage()
                .newCountryIdxKey();
        keyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId());

        CFSecurityISOCountryLanguageByLanguageIdxKey keyLanguageIdx = schema.getFactoryISOCountryLanguage()
                .newLanguageIdxKey();
        keyLanguageIdx.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());

        // Validate unique indexes

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

        // Validate foreign keys

        {
            boolean allNull = true;
            allNull = false;
            if (!allNull) {
                if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization,
                        Buff.getRequiredISOCountryId())) {
                    throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                            "createISOCountryLanguage", "Container", "ISOCountryLanguageCountry", "ISOCountry",
                            null);
                }
            }
        }

        // Proceed with adding the new record

        dictByPKey.put(pkey, Buff);

        SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff> subdictCountryIdx;
        if (dictByCountryIdx.containsKey(keyCountryIdx)) {
            subdictCountryIdx = dictByCountryIdx.get(keyCountryIdx);
        } else {
            subdictCountryIdx = new TreeMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>();
            dictByCountryIdx.put(keyCountryIdx, subdictCountryIdx);
        }
        subdictCountryIdx.put(pkey, Buff);

        SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff> subdictLanguageIdx;
        if (dictByLanguageIdx.containsKey(keyLanguageIdx)) {
            subdictLanguageIdx = dictByLanguageIdx.get(keyLanguageIdx);
        } else {
            subdictLanguageIdx = new TreeMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>();
            dictByLanguageIdx.put(keyLanguageIdx, subdictLanguageIdx);
        }
        subdictLanguageIdx.put(pkey, Buff);

    }

    public CFSecurityISOCountryLanguageBuff readDerived(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguagePKey PKey) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readDerived() ";
        CFSecurityISOCountryLanguagePKey key = schema.getFactoryISOCountryLanguage().newPKey();
        key.setRequiredISOCountryId(PKey.getRequiredISOCountryId());
        key.setRequiredISOLanguageId(PKey.getRequiredISOLanguageId());
        CFSecurityISOCountryLanguageBuff buff;
        if (dictByPKey.containsKey(key)) {
            buff = dictByPKey.get(key);
        } else {
            buff = null;
        }
        return (buff);
    }

    public CFSecurityISOCountryLanguageBuff lockDerived(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguagePKey PKey) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readDerived() ";
        CFSecurityISOCountryLanguagePKey key = schema.getFactoryISOCountryLanguage().newPKey();
        key.setRequiredISOCountryId(PKey.getRequiredISOCountryId());
        key.setRequiredISOLanguageId(PKey.getRequiredISOLanguageId());
        CFSecurityISOCountryLanguageBuff buff;
        if (dictByPKey.containsKey(key)) {
            buff = dictByPKey.get(key);
        } else {
            buff = null;
        }
        return (buff);
    }

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

    public CFSecurityISOCountryLanguageBuff[] readDerivedByCountryIdx(CFSecurityAuthorization Authorization,
            short ISOCountryId) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readDerivedByCountryIdx() ";
        CFSecurityISOCountryLanguageByCountryIdxKey key = schema.getFactoryISOCountryLanguage().newCountryIdxKey();
        key.setRequiredISOCountryId(ISOCountryId);

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

    public CFSecurityISOCountryLanguageBuff[] readDerivedByLanguageIdx(CFSecurityAuthorization Authorization,
            short ISOLanguageId) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readDerivedByLanguageIdx() ";
        CFSecurityISOCountryLanguageByLanguageIdxKey key = schema.getFactoryISOCountryLanguage()
                .newLanguageIdxKey();
        key.setRequiredISOLanguageId(ISOLanguageId);

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

    public CFSecurityISOCountryLanguageBuff readDerivedByIdIdx(CFSecurityAuthorization Authorization,
            short ISOCountryId, short ISOLanguageId) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readDerivedByIdIdx() ";
        CFSecurityISOCountryLanguagePKey key = schema.getFactoryISOCountryLanguage().newPKey();
        key.setRequiredISOCountryId(ISOCountryId);
        key.setRequiredISOLanguageId(ISOLanguageId);

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

    public CFSecurityISOCountryLanguageBuff readBuff(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguagePKey PKey) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readBuff() ";
        CFSecurityISOCountryLanguageBuff buff = readDerived(Authorization, PKey);
        if ((buff != null) && (!buff.getClassCode().equals("ISCL"))) {
            buff = null;
        }
        return (buff);
    }

    public CFSecurityISOCountryLanguageBuff lockBuff(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguagePKey PKey) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readBuff() ";
        CFSecurityISOCountryLanguageBuff buff = readDerived(Authorization, PKey);
        if ((buff != null) && (!buff.getClassCode().equals("ISCL"))) {
            buff = null;
        }
        return (buff);
    }

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

    public CFSecurityISOCountryLanguageBuff readBuffByIdIdx(CFSecurityAuthorization Authorization,
            short ISOCountryId, short ISOLanguageId) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readBuffByIdIdx() ";
        CFSecurityISOCountryLanguageBuff buff = readDerivedByIdIdx(Authorization, ISOCountryId, ISOLanguageId);
        if ((buff != null) && buff.getClassCode().equals("ISCL")) {
            return ((CFSecurityISOCountryLanguageBuff) buff);
        } else {
            return (null);
        }
    }

    public CFSecurityISOCountryLanguageBuff[] readBuffByCountryIdx(CFSecurityAuthorization Authorization,
            short ISOCountryId) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readBuffByCountryIdx() ";
        CFSecurityISOCountryLanguageBuff buff;
        ArrayList<CFSecurityISOCountryLanguageBuff> filteredList = new ArrayList<CFSecurityISOCountryLanguageBuff>();
        CFSecurityISOCountryLanguageBuff[] buffList = readDerivedByCountryIdx(Authorization, ISOCountryId);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ISCL")) {
                filteredList.add((CFSecurityISOCountryLanguageBuff) buff);
            }
        }
        return (filteredList.toArray(new CFSecurityISOCountryLanguageBuff[0]));
    }

    public CFSecurityISOCountryLanguageBuff[] readBuffByLanguageIdx(CFSecurityAuthorization Authorization,
            short ISOLanguageId) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguage.readBuffByLanguageIdx() ";
        CFSecurityISOCountryLanguageBuff buff;
        ArrayList<CFSecurityISOCountryLanguageBuff> filteredList = new ArrayList<CFSecurityISOCountryLanguageBuff>();
        CFSecurityISOCountryLanguageBuff[] buffList = readDerivedByLanguageIdx(Authorization, ISOLanguageId);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ISCL")) {
                filteredList.add((CFSecurityISOCountryLanguageBuff) buff);
            }
        }
        return (filteredList.toArray(new CFSecurityISOCountryLanguageBuff[0]));
    }

    public void updateISOCountryLanguage(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguageBuff Buff) {
        CFSecurityISOCountryLanguagePKey pkey = schema.getFactoryISOCountryLanguage().newPKey();
        pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId());
        pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());
        CFSecurityISOCountryLanguageBuff existing = dictByPKey.get(pkey);
        if (existing == null) {
            throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(),
                    "updateISOCountryLanguage", "Existing record not found", "ISOCountryLanguage", pkey);
        }
        if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
            throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                    "updateISOCountryLanguage", pkey);
        }
        Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
        CFSecurityISOCountryLanguageByCountryIdxKey existingKeyCountryIdx = schema.getFactoryISOCountryLanguage()
                .newCountryIdxKey();
        existingKeyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId());

        CFSecurityISOCountryLanguageByCountryIdxKey newKeyCountryIdx = schema.getFactoryISOCountryLanguage()
                .newCountryIdxKey();
        newKeyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId());

        CFSecurityISOCountryLanguageByLanguageIdxKey existingKeyLanguageIdx = schema.getFactoryISOCountryLanguage()
                .newLanguageIdxKey();
        existingKeyLanguageIdx.setRequiredISOLanguageId(existing.getRequiredISOLanguageId());

        CFSecurityISOCountryLanguageByLanguageIdxKey newKeyLanguageIdx = schema.getFactoryISOCountryLanguage()
                .newLanguageIdxKey();
        newKeyLanguageIdx.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());

        // Check unique indexes

        // Validate foreign keys

        {
            boolean allNull = true;

            if (allNull) {
                if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization,
                        Buff.getRequiredISOCountryId())) {
                    throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(),
                            "updateISOCountryLanguage", "Container", "ISOCountryLanguageCountry", "ISOCountry",
                            null);
                }
            }
        }

        // Update is valid

        SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff> subdict;

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

        subdict = dictByCountryIdx.get(existingKeyCountryIdx);
        if (subdict != null) {
            subdict.remove(pkey);
        }
        if (dictByCountryIdx.containsKey(newKeyCountryIdx)) {
            subdict = dictByCountryIdx.get(newKeyCountryIdx);
        } else {
            subdict = new TreeMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>();
            dictByCountryIdx.put(newKeyCountryIdx, subdict);
        }
        subdict.put(pkey, Buff);

        subdict = dictByLanguageIdx.get(existingKeyLanguageIdx);
        if (subdict != null) {
            subdict.remove(pkey);
        }
        if (dictByLanguageIdx.containsKey(newKeyLanguageIdx)) {
            subdict = dictByLanguageIdx.get(newKeyLanguageIdx);
        } else {
            subdict = new TreeMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff>();
            dictByLanguageIdx.put(newKeyLanguageIdx, subdict);
        }
        subdict.put(pkey, Buff);

    }

    public void deleteISOCountryLanguage(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguageBuff Buff) {
        final String S_ProcName = "CFSecurityRamISOCountryLanguageTable.deleteISOCountryLanguage() ";
        CFSecurityISOCountryLanguagePKey pkey = schema.getFactoryISOCountryLanguage().newPKey();
        pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId());
        pkey.setRequiredISOLanguageId(Buff.getRequiredISOLanguageId());
        CFSecurityISOCountryLanguageBuff existing = dictByPKey.get(pkey);
        if (existing == null) {
            return;
        }
        if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
            throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(),
                    "deleteISOCountryLanguage", pkey);
        }
        CFSecurityISOCountryLanguageByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryLanguage()
                .newCountryIdxKey();
        keyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId());

        CFSecurityISOCountryLanguageByLanguageIdxKey keyLanguageIdx = schema.getFactoryISOCountryLanguage()
                .newLanguageIdxKey();
        keyLanguageIdx.setRequiredISOLanguageId(existing.getRequiredISOLanguageId());

        // Validate reverse foreign keys

        // Delete is valid

        SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff> subdict;

        dictByPKey.remove(pkey);

        subdict = dictByCountryIdx.get(keyCountryIdx);
        subdict.remove(pkey);

        subdict = dictByLanguageIdx.get(keyLanguageIdx);
        subdict.remove(pkey);

    }

    public void deleteISOCountryLanguageByIdIdx(CFSecurityAuthorization Authorization, short argISOCountryId,
            short argISOLanguageId) {
        CFSecurityISOCountryLanguagePKey key = schema.getFactoryISOCountryLanguage().newPKey();
        key.setRequiredISOCountryId(argISOCountryId);
        key.setRequiredISOLanguageId(argISOLanguageId);
        deleteISOCountryLanguageByIdIdx(Authorization, key);
    }

    public void deleteISOCountryLanguageByIdIdx(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguagePKey argKey) {
        CFSecurityISOCountryLanguageBuff cur;
        LinkedList<CFSecurityISOCountryLanguageBuff> matchSet = new LinkedList<CFSecurityISOCountryLanguageBuff>();
        Iterator<CFSecurityISOCountryLanguageBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFSecurityISOCountryLanguageBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteISOCountryLanguage(Authorization, cur);
        }
    }

    public void deleteISOCountryLanguageByCountryIdx(CFSecurityAuthorization Authorization, short argISOCountryId) {
        CFSecurityISOCountryLanguageByCountryIdxKey key = schema.getFactoryISOCountryLanguage().newCountryIdxKey();
        key.setRequiredISOCountryId(argISOCountryId);
        deleteISOCountryLanguageByCountryIdx(Authorization, key);
    }

    public void deleteISOCountryLanguageByCountryIdx(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguageByCountryIdxKey argKey) {
        CFSecurityISOCountryLanguageBuff cur;
        LinkedList<CFSecurityISOCountryLanguageBuff> matchSet = new LinkedList<CFSecurityISOCountryLanguageBuff>();
        Iterator<CFSecurityISOCountryLanguageBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFSecurityISOCountryLanguageBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteISOCountryLanguage(Authorization, cur);
        }
    }

    public void deleteISOCountryLanguageByLanguageIdx(CFSecurityAuthorization Authorization,
            short argISOLanguageId) {
        CFSecurityISOCountryLanguageByLanguageIdxKey key = schema.getFactoryISOCountryLanguage()
                .newLanguageIdxKey();
        key.setRequiredISOLanguageId(argISOLanguageId);
        deleteISOCountryLanguageByLanguageIdx(Authorization, key);
    }

    public void deleteISOCountryLanguageByLanguageIdx(CFSecurityAuthorization Authorization,
            CFSecurityISOCountryLanguageByLanguageIdxKey argKey) {
        CFSecurityISOCountryLanguageBuff cur;
        LinkedList<CFSecurityISOCountryLanguageBuff> matchSet = new LinkedList<CFSecurityISOCountryLanguageBuff>();
        Iterator<CFSecurityISOCountryLanguageBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFSecurityISOCountryLanguageBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteISOCountryLanguage(Authorization, cur);
        }
    }

    public CFSecurityCursor openISOCountryLanguageCursorAll(CFSecurityAuthorization Authorization) {
        CFSecurityCursor cursor = new CFSecurityRamISOCountryLanguageCursor(Authorization, schema,
                dictByPKey.values());
        return (cursor);
    }

    public CFSecurityCursor openISOCountryLanguageCursorByCountryIdx(CFSecurityAuthorization Authorization,
            short ISOCountryId) {
        CFSecurityCursor cursor;
        CFSecurityISOCountryLanguageByCountryIdxKey key = schema.getFactoryISOCountryLanguage().newCountryIdxKey();
        key.setRequiredISOCountryId(ISOCountryId);

        if (dictByCountryIdx.containsKey(key)) {
            SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff> subdictCountryIdx = dictByCountryIdx
                    .get(key);
            cursor = new CFSecurityRamISOCountryLanguageCursor(Authorization, schema, subdictCountryIdx.values());
        } else {
            cursor = new CFSecurityRamISOCountryLanguageCursor(Authorization, schema,
                    new ArrayList<CFSecurityISOCountryLanguageBuff>());
        }
        return (cursor);
    }

    public CFSecurityCursor openISOCountryLanguageCursorByLanguageIdx(CFSecurityAuthorization Authorization,
            short ISOLanguageId) {
        CFSecurityCursor cursor;
        CFSecurityISOCountryLanguageByLanguageIdxKey key = schema.getFactoryISOCountryLanguage()
                .newLanguageIdxKey();
        key.setRequiredISOLanguageId(ISOLanguageId);

        if (dictByLanguageIdx.containsKey(key)) {
            SortedMap<CFSecurityISOCountryLanguagePKey, CFSecurityISOCountryLanguageBuff> subdictLanguageIdx = dictByLanguageIdx
                    .get(key);
            cursor = new CFSecurityRamISOCountryLanguageCursor(Authorization, schema, subdictLanguageIdx.values());
        } else {
            cursor = new CFSecurityRamISOCountryLanguageCursor(Authorization, schema,
                    new ArrayList<CFSecurityISOCountryLanguageBuff>());
        }
        return (cursor);
    }

    public void closeISOCountryLanguageCursor(CFSecurityCursor Cursor) {
        // Cursor.DataReader.Close();
    }

    public CFSecurityISOCountryLanguageBuff nextISOCountryLanguageCursor(CFSecurityCursor Cursor) {
        CFSecurityRamISOCountryLanguageCursor cursor = (CFSecurityRamISOCountryLanguageCursor) Cursor;
        CFSecurityISOCountryLanguageBuff rec = cursor.getCursor().next();
        cursor.setRowIdx(cursor.getRowIdx() + 1);
        return (rec);
    }

    public CFSecurityISOCountryLanguageBuff prevISOCountryLanguageCursor(CFSecurityCursor Cursor) {
        int targetRowIdx = (Cursor.getRowIdx() > 1) ? Cursor.getRowIdx() - 1 : 1;
        CFSecurityISOCountryLanguageBuff rec = null;
        if (Cursor.getRowIdx() >= targetRowIdx) {
            Cursor.reset();
        }
        while (Cursor.getRowIdx() < targetRowIdx) {
            rec = nextISOCountryLanguageCursor(Cursor);
        }
        return (rec);
    }

    public CFSecurityISOCountryLanguageBuff firstISOCountryLanguageCursor(CFSecurityCursor Cursor) {
        int targetRowIdx = 1;
        CFSecurityISOCountryLanguageBuff rec = null;
        Cursor.reset();
        while (Cursor.getRowIdx() < targetRowIdx) {
            rec = nextISOCountryLanguageCursor(Cursor);
        }
        return (rec);
    }

    public CFSecurityISOCountryLanguageBuff lastISOCountryLanguageCursor(CFSecurityCursor Cursor) {
        throw CFLib.getDefaultExceptionFactory().newNotImplementedYetException(getClass(),
                "lastISOCountryLanguageCursor");
    }

    public CFSecurityISOCountryLanguageBuff nthISOCountryLanguageCursor(CFSecurityCursor Cursor, int Idx) {
        int targetRowIdx = Idx;
        CFSecurityISOCountryLanguageBuff rec = null;
        if (Cursor.getRowIdx() >= targetRowIdx) {
            Cursor.reset();
        }
        while (Cursor.getRowIdx() < targetRowIdx) {
            rec = nextISOCountryLanguageCursor(Cursor);
        }
        return (rec);
    }

    public void releasePreparedStatements() {
    }
}