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

Java tutorial

Introduction

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

Source

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

/*
 *   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.*;

/*
 *   CFSecurityRamISOTimezoneTable in-memory RAM DbIO implementation
 *   for ISOTimezone.
 */
public class CFSecurityRamISOTimezoneTable implements ICFSecurityISOTimezoneTable {
    private CFSecurityRamSchema schema;
    private Map<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff> dictByPKey = new HashMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff>();
    private SortedMap<CFSecurityISOTimezoneByOffsetIdxKey, SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff>> dictByOffsetIdx = new TreeMap<CFSecurityISOTimezoneByOffsetIdxKey, SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff>>();
    private SortedMap<CFSecurityISOTimezoneByUTZNameIdxKey, CFSecurityISOTimezoneBuff> dictByUTZNameIdx = new TreeMap<CFSecurityISOTimezoneByUTZNameIdxKey, CFSecurityISOTimezoneBuff>();
    private SortedMap<CFSecurityISOTimezoneByIso8601IdxKey, SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff>> dictByIso8601Idx = new TreeMap<CFSecurityISOTimezoneByIso8601IdxKey, SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff>>();

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

    public void createISOTimezone(CFSecurityAuthorization Authorization, CFSecurityISOTimezoneBuff Buff) {
        CFSecurityISOTimezonePKey pkey = schema.getFactoryISOTimezone().newPKey();
        pkey.setRequiredISOTimezoneId(Buff.getRequiredISOTimezoneId());
        Buff.setRequiredISOTimezoneId(pkey.getRequiredISOTimezoneId());
        CFSecurityISOTimezoneByOffsetIdxKey keyOffsetIdx = schema.getFactoryISOTimezone().newOffsetIdxKey();
        keyOffsetIdx.setRequiredTZHourOffset(Buff.getRequiredTZHourOffset());
        keyOffsetIdx.setRequiredTZMinOffset(Buff.getRequiredTZMinOffset());

        CFSecurityISOTimezoneByUTZNameIdxKey keyUTZNameIdx = schema.getFactoryISOTimezone().newUTZNameIdxKey();
        keyUTZNameIdx.setRequiredTZName(Buff.getRequiredTZName());

        CFSecurityISOTimezoneByIso8601IdxKey keyIso8601Idx = schema.getFactoryISOTimezone().newIso8601IdxKey();
        keyIso8601Idx.setRequiredIso8601(Buff.getRequiredIso8601());

        // Validate unique indexes

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

        if (dictByUTZNameIdx.containsKey(keyUTZNameIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                    "createISOTimezone", "ISOTimezoneUTZNameIdx", keyUTZNameIdx);
        }

        // Validate foreign keys

        // Proceed with adding the new record

        dictByPKey.put(pkey, Buff);

        SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff> subdictOffsetIdx;
        if (dictByOffsetIdx.containsKey(keyOffsetIdx)) {
            subdictOffsetIdx = dictByOffsetIdx.get(keyOffsetIdx);
        } else {
            subdictOffsetIdx = new TreeMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff>();
            dictByOffsetIdx.put(keyOffsetIdx, subdictOffsetIdx);
        }
        subdictOffsetIdx.put(pkey, Buff);

        dictByUTZNameIdx.put(keyUTZNameIdx, Buff);

        SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff> subdictIso8601Idx;
        if (dictByIso8601Idx.containsKey(keyIso8601Idx)) {
            subdictIso8601Idx = dictByIso8601Idx.get(keyIso8601Idx);
        } else {
            subdictIso8601Idx = new TreeMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff>();
            dictByIso8601Idx.put(keyIso8601Idx, subdictIso8601Idx);
        }
        subdictIso8601Idx.put(pkey, Buff);

    }

    public CFSecurityISOTimezoneBuff readDerived(CFSecurityAuthorization Authorization,
            CFSecurityISOTimezonePKey PKey) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readDerived() ";
        CFSecurityISOTimezonePKey key = schema.getFactoryISOTimezone().newPKey();
        key.setRequiredISOTimezoneId(PKey.getRequiredISOTimezoneId());
        CFSecurityISOTimezoneBuff buff;
        if (dictByPKey.containsKey(key)) {
            buff = dictByPKey.get(key);
        } else {
            buff = null;
        }
        return (buff);
    }

    public CFSecurityISOTimezoneBuff lockDerived(CFSecurityAuthorization Authorization,
            CFSecurityISOTimezonePKey PKey) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readDerived() ";
        CFSecurityISOTimezonePKey key = schema.getFactoryISOTimezone().newPKey();
        key.setRequiredISOTimezoneId(PKey.getRequiredISOTimezoneId());
        CFSecurityISOTimezoneBuff buff;
        if (dictByPKey.containsKey(key)) {
            buff = dictByPKey.get(key);
        } else {
            buff = null;
        }
        return (buff);
    }

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

    public CFSecurityISOTimezoneBuff[] readDerivedByOffsetIdx(CFSecurityAuthorization Authorization,
            short TZHourOffset, short TZMinOffset) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readDerivedByOffsetIdx() ";
        CFSecurityISOTimezoneByOffsetIdxKey key = schema.getFactoryISOTimezone().newOffsetIdxKey();
        key.setRequiredTZHourOffset(TZHourOffset);
        key.setRequiredTZMinOffset(TZMinOffset);

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

    public CFSecurityISOTimezoneBuff readDerivedByUTZNameIdx(CFSecurityAuthorization Authorization, String TZName) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readDerivedByUTZNameIdx() ";
        CFSecurityISOTimezoneByUTZNameIdxKey key = schema.getFactoryISOTimezone().newUTZNameIdxKey();
        key.setRequiredTZName(TZName);

        CFSecurityISOTimezoneBuff buff;
        if (dictByUTZNameIdx.containsKey(key)) {
            buff = dictByUTZNameIdx.get(key);
        } else {
            buff = null;
        }
        return (buff);
    }

    public CFSecurityISOTimezoneBuff[] readDerivedByIso8601Idx(CFSecurityAuthorization Authorization,
            String Iso8601) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readDerivedByIso8601Idx() ";
        CFSecurityISOTimezoneByIso8601IdxKey key = schema.getFactoryISOTimezone().newIso8601IdxKey();
        key.setRequiredIso8601(Iso8601);

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

    public CFSecurityISOTimezoneBuff readDerivedByIdIdx(CFSecurityAuthorization Authorization,
            short ISOTimezoneId) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readDerivedByIdIdx() ";
        CFSecurityISOTimezonePKey key = schema.getFactoryISOTimezone().newPKey();
        key.setRequiredISOTimezoneId(ISOTimezoneId);

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

    public CFSecurityISOTimezoneBuff readBuff(CFSecurityAuthorization Authorization,
            CFSecurityISOTimezonePKey PKey) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readBuff() ";
        CFSecurityISOTimezoneBuff buff = readDerived(Authorization, PKey);
        if ((buff != null) && (!buff.getClassCode().equals("ITZN"))) {
            buff = null;
        }
        return (buff);
    }

    public CFSecurityISOTimezoneBuff lockBuff(CFSecurityAuthorization Authorization,
            CFSecurityISOTimezonePKey PKey) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readBuff() ";
        CFSecurityISOTimezoneBuff buff = readDerived(Authorization, PKey);
        if ((buff != null) && (!buff.getClassCode().equals("ITZN"))) {
            buff = null;
        }
        return (buff);
    }

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

    public CFSecurityISOTimezoneBuff readBuffByIdIdx(CFSecurityAuthorization Authorization, short ISOTimezoneId) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readBuffByIdIdx() ";
        CFSecurityISOTimezoneBuff buff = readDerivedByIdIdx(Authorization, ISOTimezoneId);
        if ((buff != null) && buff.getClassCode().equals("ITZN")) {
            return ((CFSecurityISOTimezoneBuff) buff);
        } else {
            return (null);
        }
    }

    public CFSecurityISOTimezoneBuff[] readBuffByOffsetIdx(CFSecurityAuthorization Authorization,
            short TZHourOffset, short TZMinOffset) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readBuffByOffsetIdx() ";
        CFSecurityISOTimezoneBuff buff;
        ArrayList<CFSecurityISOTimezoneBuff> filteredList = new ArrayList<CFSecurityISOTimezoneBuff>();
        CFSecurityISOTimezoneBuff[] buffList = readDerivedByOffsetIdx(Authorization, TZHourOffset, TZMinOffset);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ITZN")) {
                filteredList.add((CFSecurityISOTimezoneBuff) buff);
            }
        }
        return (filteredList.toArray(new CFSecurityISOTimezoneBuff[0]));
    }

    public CFSecurityISOTimezoneBuff readBuffByUTZNameIdx(CFSecurityAuthorization Authorization, String TZName) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readBuffByUTZNameIdx() ";
        CFSecurityISOTimezoneBuff buff = readDerivedByUTZNameIdx(Authorization, TZName);
        if ((buff != null) && buff.getClassCode().equals("ITZN")) {
            return ((CFSecurityISOTimezoneBuff) buff);
        } else {
            return (null);
        }
    }

    public CFSecurityISOTimezoneBuff[] readBuffByIso8601Idx(CFSecurityAuthorization Authorization, String Iso8601) {
        final String S_ProcName = "CFSecurityRamISOTimezone.readBuffByIso8601Idx() ";
        CFSecurityISOTimezoneBuff buff;
        ArrayList<CFSecurityISOTimezoneBuff> filteredList = new ArrayList<CFSecurityISOTimezoneBuff>();
        CFSecurityISOTimezoneBuff[] buffList = readDerivedByIso8601Idx(Authorization, Iso8601);
        for (int idx = 0; idx < buffList.length; idx++) {
            buff = buffList[idx];
            if ((buff != null) && buff.getClassCode().equals("ITZN")) {
                filteredList.add((CFSecurityISOTimezoneBuff) buff);
            }
        }
        return (filteredList.toArray(new CFSecurityISOTimezoneBuff[0]));
    }

    public void updateISOTimezone(CFSecurityAuthorization Authorization, CFSecurityISOTimezoneBuff Buff) {
        CFSecurityISOTimezonePKey pkey = schema.getFactoryISOTimezone().newPKey();
        pkey.setRequiredISOTimezoneId(Buff.getRequiredISOTimezoneId());
        CFSecurityISOTimezoneBuff existing = dictByPKey.get(pkey);
        if (existing == null) {
            throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOTimezone",
                    "Existing record not found", "ISOTimezone", pkey);
        }
        if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
            throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOTimezone",
                    pkey);
        }
        Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
        CFSecurityISOTimezoneByOffsetIdxKey existingKeyOffsetIdx = schema.getFactoryISOTimezone().newOffsetIdxKey();
        existingKeyOffsetIdx.setRequiredTZHourOffset(existing.getRequiredTZHourOffset());
        existingKeyOffsetIdx.setRequiredTZMinOffset(existing.getRequiredTZMinOffset());

        CFSecurityISOTimezoneByOffsetIdxKey newKeyOffsetIdx = schema.getFactoryISOTimezone().newOffsetIdxKey();
        newKeyOffsetIdx.setRequiredTZHourOffset(Buff.getRequiredTZHourOffset());
        newKeyOffsetIdx.setRequiredTZMinOffset(Buff.getRequiredTZMinOffset());

        CFSecurityISOTimezoneByUTZNameIdxKey existingKeyUTZNameIdx = schema.getFactoryISOTimezone()
                .newUTZNameIdxKey();
        existingKeyUTZNameIdx.setRequiredTZName(existing.getRequiredTZName());

        CFSecurityISOTimezoneByUTZNameIdxKey newKeyUTZNameIdx = schema.getFactoryISOTimezone().newUTZNameIdxKey();
        newKeyUTZNameIdx.setRequiredTZName(Buff.getRequiredTZName());

        CFSecurityISOTimezoneByIso8601IdxKey existingKeyIso8601Idx = schema.getFactoryISOTimezone()
                .newIso8601IdxKey();
        existingKeyIso8601Idx.setRequiredIso8601(existing.getRequiredIso8601());

        CFSecurityISOTimezoneByIso8601IdxKey newKeyIso8601Idx = schema.getFactoryISOTimezone().newIso8601IdxKey();
        newKeyIso8601Idx.setRequiredIso8601(Buff.getRequiredIso8601());

        // Check unique indexes

        if (!existingKeyUTZNameIdx.equals(newKeyUTZNameIdx)) {
            if (dictByUTZNameIdx.containsKey(newKeyUTZNameIdx)) {
                throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(),
                        "updateISOTimezone", "ISOTimezoneUTZNameIdx", newKeyUTZNameIdx);
            }
        }

        // Validate foreign keys

        // Update is valid

        SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff> subdict;

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

        subdict = dictByOffsetIdx.get(existingKeyOffsetIdx);
        if (subdict != null) {
            subdict.remove(pkey);
        }
        if (dictByOffsetIdx.containsKey(newKeyOffsetIdx)) {
            subdict = dictByOffsetIdx.get(newKeyOffsetIdx);
        } else {
            subdict = new TreeMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff>();
            dictByOffsetIdx.put(newKeyOffsetIdx, subdict);
        }
        subdict.put(pkey, Buff);

        dictByUTZNameIdx.remove(existingKeyUTZNameIdx);
        dictByUTZNameIdx.put(newKeyUTZNameIdx, Buff);

        subdict = dictByIso8601Idx.get(existingKeyIso8601Idx);
        if (subdict != null) {
            subdict.remove(pkey);
        }
        if (dictByIso8601Idx.containsKey(newKeyIso8601Idx)) {
            subdict = dictByIso8601Idx.get(newKeyIso8601Idx);
        } else {
            subdict = new TreeMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff>();
            dictByIso8601Idx.put(newKeyIso8601Idx, subdict);
        }
        subdict.put(pkey, Buff);

    }

    public void deleteISOTimezone(CFSecurityAuthorization Authorization, CFSecurityISOTimezoneBuff Buff) {
        final String S_ProcName = "CFSecurityRamISOTimezoneTable.deleteISOTimezone() ";
        CFSecurityISOTimezonePKey pkey = schema.getFactoryISOTimezone().newPKey();
        pkey.setRequiredISOTimezoneId(Buff.getRequiredISOTimezoneId());
        CFSecurityISOTimezoneBuff existing = dictByPKey.get(pkey);
        if (existing == null) {
            return;
        }
        if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
            throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteISOTimezone",
                    pkey);
        }
        CFSecurityISOTimezoneByOffsetIdxKey keyOffsetIdx = schema.getFactoryISOTimezone().newOffsetIdxKey();
        keyOffsetIdx.setRequiredTZHourOffset(existing.getRequiredTZHourOffset());
        keyOffsetIdx.setRequiredTZMinOffset(existing.getRequiredTZMinOffset());

        CFSecurityISOTimezoneByUTZNameIdxKey keyUTZNameIdx = schema.getFactoryISOTimezone().newUTZNameIdxKey();
        keyUTZNameIdx.setRequiredTZName(existing.getRequiredTZName());

        CFSecurityISOTimezoneByIso8601IdxKey keyIso8601Idx = schema.getFactoryISOTimezone().newIso8601IdxKey();
        keyIso8601Idx.setRequiredIso8601(existing.getRequiredIso8601());

        // Validate reverse foreign keys

        // Delete is valid

        SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff> subdict;

        dictByPKey.remove(pkey);

        subdict = dictByOffsetIdx.get(keyOffsetIdx);
        subdict.remove(pkey);

        dictByUTZNameIdx.remove(keyUTZNameIdx);

        subdict = dictByIso8601Idx.get(keyIso8601Idx);
        subdict.remove(pkey);

    }

    public void deleteISOTimezoneByIdIdx(CFSecurityAuthorization Authorization, short argISOTimezoneId) {
        CFSecurityISOTimezonePKey key = schema.getFactoryISOTimezone().newPKey();
        key.setRequiredISOTimezoneId(argISOTimezoneId);
        deleteISOTimezoneByIdIdx(Authorization, key);
    }

    public void deleteISOTimezoneByIdIdx(CFSecurityAuthorization Authorization, CFSecurityISOTimezonePKey argKey) {
        CFSecurityISOTimezoneBuff cur;
        LinkedList<CFSecurityISOTimezoneBuff> matchSet = new LinkedList<CFSecurityISOTimezoneBuff>();
        Iterator<CFSecurityISOTimezoneBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFSecurityISOTimezoneBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteISOTimezone(Authorization, cur);
        }
    }

    public void deleteISOTimezoneByOffsetIdx(CFSecurityAuthorization Authorization, short argTZHourOffset,
            short argTZMinOffset) {
        CFSecurityISOTimezoneByOffsetIdxKey key = schema.getFactoryISOTimezone().newOffsetIdxKey();
        key.setRequiredTZHourOffset(argTZHourOffset);
        key.setRequiredTZMinOffset(argTZMinOffset);
        deleteISOTimezoneByOffsetIdx(Authorization, key);
    }

    public void deleteISOTimezoneByOffsetIdx(CFSecurityAuthorization Authorization,
            CFSecurityISOTimezoneByOffsetIdxKey argKey) {
        CFSecurityISOTimezoneBuff cur;
        LinkedList<CFSecurityISOTimezoneBuff> matchSet = new LinkedList<CFSecurityISOTimezoneBuff>();
        Iterator<CFSecurityISOTimezoneBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFSecurityISOTimezoneBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteISOTimezone(Authorization, cur);
        }
    }

    public void deleteISOTimezoneByUTZNameIdx(CFSecurityAuthorization Authorization, String argTZName) {
        CFSecurityISOTimezoneByUTZNameIdxKey key = schema.getFactoryISOTimezone().newUTZNameIdxKey();
        key.setRequiredTZName(argTZName);
        deleteISOTimezoneByUTZNameIdx(Authorization, key);
    }

    public void deleteISOTimezoneByUTZNameIdx(CFSecurityAuthorization Authorization,
            CFSecurityISOTimezoneByUTZNameIdxKey argKey) {
        CFSecurityISOTimezoneBuff cur;
        LinkedList<CFSecurityISOTimezoneBuff> matchSet = new LinkedList<CFSecurityISOTimezoneBuff>();
        Iterator<CFSecurityISOTimezoneBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFSecurityISOTimezoneBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteISOTimezone(Authorization, cur);
        }
    }

    public void deleteISOTimezoneByIso8601Idx(CFSecurityAuthorization Authorization, String argIso8601) {
        CFSecurityISOTimezoneByIso8601IdxKey key = schema.getFactoryISOTimezone().newIso8601IdxKey();
        key.setRequiredIso8601(argIso8601);
        deleteISOTimezoneByIso8601Idx(Authorization, key);
    }

    public void deleteISOTimezoneByIso8601Idx(CFSecurityAuthorization Authorization,
            CFSecurityISOTimezoneByIso8601IdxKey argKey) {
        CFSecurityISOTimezoneBuff cur;
        LinkedList<CFSecurityISOTimezoneBuff> matchSet = new LinkedList<CFSecurityISOTimezoneBuff>();
        Iterator<CFSecurityISOTimezoneBuff> values = dictByPKey.values().iterator();
        while (values.hasNext()) {
            cur = values.next();
            if (argKey.equals(cur)) {
                matchSet.add(cur);
            }
        }
        Iterator<CFSecurityISOTimezoneBuff> iterMatch = matchSet.iterator();
        while (iterMatch.hasNext()) {
            cur = iterMatch.next();
            deleteISOTimezone(Authorization, cur);
        }
    }

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

    public CFSecurityCursor openISOTimezoneCursorByOffsetIdx(CFSecurityAuthorization Authorization,
            short TZHourOffset, short TZMinOffset) {
        CFSecurityCursor cursor;
        CFSecurityISOTimezoneByOffsetIdxKey key = schema.getFactoryISOTimezone().newOffsetIdxKey();
        key.setRequiredTZHourOffset(TZHourOffset);
        key.setRequiredTZMinOffset(TZMinOffset);

        if (dictByOffsetIdx.containsKey(key)) {
            SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff> subdictOffsetIdx = dictByOffsetIdx
                    .get(key);
            cursor = new CFSecurityRamISOTimezoneCursor(Authorization, schema, subdictOffsetIdx.values());
        } else {
            cursor = new CFSecurityRamISOTimezoneCursor(Authorization, schema,
                    new ArrayList<CFSecurityISOTimezoneBuff>());
        }
        return (cursor);
    }

    public CFSecurityCursor openISOTimezoneCursorByIso8601Idx(CFSecurityAuthorization Authorization,
            String Iso8601) {
        CFSecurityCursor cursor;
        CFSecurityISOTimezoneByIso8601IdxKey key = schema.getFactoryISOTimezone().newIso8601IdxKey();
        key.setRequiredIso8601(Iso8601);

        if (dictByIso8601Idx.containsKey(key)) {
            SortedMap<CFSecurityISOTimezonePKey, CFSecurityISOTimezoneBuff> subdictIso8601Idx = dictByIso8601Idx
                    .get(key);
            cursor = new CFSecurityRamISOTimezoneCursor(Authorization, schema, subdictIso8601Idx.values());
        } else {
            cursor = new CFSecurityRamISOTimezoneCursor(Authorization, schema,
                    new ArrayList<CFSecurityISOTimezoneBuff>());
        }
        return (cursor);
    }

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

    public CFSecurityISOTimezoneBuff nextISOTimezoneCursor(CFSecurityCursor Cursor) {
        CFSecurityRamISOTimezoneCursor cursor = (CFSecurityRamISOTimezoneCursor) Cursor;
        CFSecurityISOTimezoneBuff rec = cursor.getCursor().next();
        cursor.setRowIdx(cursor.getRowIdx() + 1);
        return (rec);
    }

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

    public CFSecurityISOTimezoneBuff firstISOTimezoneCursor(CFSecurityCursor Cursor) {
        int targetRowIdx = 1;
        CFSecurityISOTimezoneBuff rec = null;
        Cursor.reset();
        while (Cursor.getRowIdx() < targetRowIdx) {
            rec = nextISOTimezoneCursor(Cursor);
        }
        return (rec);
    }

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

    public CFSecurityISOTimezoneBuff nthISOTimezoneCursor(CFSecurityCursor Cursor, int Idx) {
        int targetRowIdx = Idx;
        CFSecurityISOTimezoneBuff rec = null;
        if (Cursor.getRowIdx() >= targetRowIdx) {
            Cursor.reset();
        }
        while (Cursor.getRowIdx() < targetRowIdx) {
            rec = nextISOTimezoneCursor(Cursor);
        }
        return (rec);
    }

    public void releasePreparedStatements() {
    }
}