Java tutorial
// Description: Java7 in-memory RAM DbIO implementation for ISOCountryCurrency. /* * 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.*; /* * CFSecurityRamISOCountryCurrencyTable in-memory RAM DbIO implementation * for ISOCountryCurrency. */ public class CFSecurityRamISOCountryCurrencyTable implements ICFSecurityISOCountryCurrencyTable { private CFSecurityRamSchema schema; private Map<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> dictByPKey = new HashMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>(); private SortedMap<CFSecurityISOCountryCurrencyByCountryIdxKey, SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>> dictByCountryIdx = new TreeMap<CFSecurityISOCountryCurrencyByCountryIdxKey, SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>>(); private SortedMap<CFSecurityISOCountryCurrencyByCurrencyIdxKey, SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>> dictByCurrencyIdx = new TreeMap<CFSecurityISOCountryCurrencyByCurrencyIdxKey, SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>>(); public CFSecurityRamISOCountryCurrencyTable(CFSecurityRamSchema argSchema) { schema = argSchema; } public void createISOCountryCurrency(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyBuff Buff) { CFSecurityISOCountryCurrencyPKey pkey = schema.getFactoryISOCountryCurrency().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId()); Buff.setRequiredISOCountryId(pkey.getRequiredISOCountryId()); Buff.setRequiredISOCurrencyId(pkey.getRequiredISOCurrencyId()); CFSecurityISOCountryCurrencyByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryCurrency() .newCountryIdxKey(); keyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); CFSecurityISOCountryCurrencyByCurrencyIdxKey keyCurrencyIdx = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); keyCurrencyIdx.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId()); // Validate unique indexes if (dictByPKey.containsKey(pkey)) { throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createISOCountryCurrency", pkey); } // Validate foreign keys { boolean allNull = true; allNull = false; if (!allNull) { if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization, Buff.getRequiredISOCountryId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "createISOCountryCurrency", "Container", "ISOCountryCurrencyCountry", "ISOCountry", null); } } } // Proceed with adding the new record dictByPKey.put(pkey, Buff); SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> subdictCountryIdx; if (dictByCountryIdx.containsKey(keyCountryIdx)) { subdictCountryIdx = dictByCountryIdx.get(keyCountryIdx); } else { subdictCountryIdx = new TreeMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>(); dictByCountryIdx.put(keyCountryIdx, subdictCountryIdx); } subdictCountryIdx.put(pkey, Buff); SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> subdictCurrencyIdx; if (dictByCurrencyIdx.containsKey(keyCurrencyIdx)) { subdictCurrencyIdx = dictByCurrencyIdx.get(keyCurrencyIdx); } else { subdictCurrencyIdx = new TreeMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>(); dictByCurrencyIdx.put(keyCurrencyIdx, subdictCurrencyIdx); } subdictCurrencyIdx.put(pkey, Buff); } public CFSecurityISOCountryCurrencyBuff readDerived(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyPKey PKey) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readDerived() "; CFSecurityISOCountryCurrencyPKey key = schema.getFactoryISOCountryCurrency().newPKey(); key.setRequiredISOCountryId(PKey.getRequiredISOCountryId()); key.setRequiredISOCurrencyId(PKey.getRequiredISOCurrencyId()); CFSecurityISOCountryCurrencyBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public CFSecurityISOCountryCurrencyBuff lockDerived(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyPKey PKey) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readDerived() "; CFSecurityISOCountryCurrencyPKey key = schema.getFactoryISOCountryCurrency().newPKey(); key.setRequiredISOCountryId(PKey.getRequiredISOCountryId()); key.setRequiredISOCurrencyId(PKey.getRequiredISOCurrencyId()); CFSecurityISOCountryCurrencyBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public CFSecurityISOCountryCurrencyBuff[] readAllDerived(CFSecurityAuthorization Authorization) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readAllDerived() "; CFSecurityISOCountryCurrencyBuff[] retList = new CFSecurityISOCountryCurrencyBuff[dictByPKey.values() .size()]; Iterator<CFSecurityISOCountryCurrencyBuff> iter = dictByPKey.values().iterator(); int idx = 0; while (iter.hasNext()) { retList[idx++] = iter.next(); } return (retList); } public CFSecurityISOCountryCurrencyBuff[] readDerivedByCountryIdx(CFSecurityAuthorization Authorization, short ISOCountryId) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readDerivedByCountryIdx() "; CFSecurityISOCountryCurrencyByCountryIdxKey key = schema.getFactoryISOCountryCurrency().newCountryIdxKey(); key.setRequiredISOCountryId(ISOCountryId); CFSecurityISOCountryCurrencyBuff[] recArray; if (dictByCountryIdx.containsKey(key)) { SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> subdictCountryIdx = dictByCountryIdx .get(key); recArray = new CFSecurityISOCountryCurrencyBuff[subdictCountryIdx.size()]; Iterator<CFSecurityISOCountryCurrencyBuff> iter = subdictCountryIdx.values().iterator(); int idx = 0; while (iter.hasNext()) { recArray[idx++] = iter.next(); } } else { recArray = new CFSecurityISOCountryCurrencyBuff[0]; } return (recArray); } public CFSecurityISOCountryCurrencyBuff[] readDerivedByCurrencyIdx(CFSecurityAuthorization Authorization, short ISOCurrencyId) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readDerivedByCurrencyIdx() "; CFSecurityISOCountryCurrencyByCurrencyIdxKey key = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); key.setRequiredISOCurrencyId(ISOCurrencyId); CFSecurityISOCountryCurrencyBuff[] recArray; if (dictByCurrencyIdx.containsKey(key)) { SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> subdictCurrencyIdx = dictByCurrencyIdx .get(key); recArray = new CFSecurityISOCountryCurrencyBuff[subdictCurrencyIdx.size()]; Iterator<CFSecurityISOCountryCurrencyBuff> iter = subdictCurrencyIdx.values().iterator(); int idx = 0; while (iter.hasNext()) { recArray[idx++] = iter.next(); } } else { recArray = new CFSecurityISOCountryCurrencyBuff[0]; } return (recArray); } public CFSecurityISOCountryCurrencyBuff readDerivedByIdIdx(CFSecurityAuthorization Authorization, short ISOCountryId, short ISOCurrencyId) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readDerivedByIdIdx() "; CFSecurityISOCountryCurrencyPKey key = schema.getFactoryISOCountryCurrency().newPKey(); key.setRequiredISOCountryId(ISOCountryId); key.setRequiredISOCurrencyId(ISOCurrencyId); CFSecurityISOCountryCurrencyBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public CFSecurityISOCountryCurrencyBuff readBuff(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyPKey PKey) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readBuff() "; CFSecurityISOCountryCurrencyBuff buff = readDerived(Authorization, PKey); if ((buff != null) && (!buff.getClassCode().equals("ICCY"))) { buff = null; } return (buff); } public CFSecurityISOCountryCurrencyBuff lockBuff(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyPKey PKey) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readBuff() "; CFSecurityISOCountryCurrencyBuff buff = readDerived(Authorization, PKey); if ((buff != null) && (!buff.getClassCode().equals("ICCY"))) { buff = null; } return (buff); } public CFSecurityISOCountryCurrencyBuff[] readAllBuff(CFSecurityAuthorization Authorization) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readAllBuff() "; CFSecurityISOCountryCurrencyBuff buff; ArrayList<CFSecurityISOCountryCurrencyBuff> filteredList = new ArrayList<CFSecurityISOCountryCurrencyBuff>(); CFSecurityISOCountryCurrencyBuff[] buffList = readAllDerived(Authorization); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ICCY")) { filteredList.add(buff); } } return (filteredList.toArray(new CFSecurityISOCountryCurrencyBuff[0])); } public CFSecurityISOCountryCurrencyBuff readBuffByIdIdx(CFSecurityAuthorization Authorization, short ISOCountryId, short ISOCurrencyId) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readBuffByIdIdx() "; CFSecurityISOCountryCurrencyBuff buff = readDerivedByIdIdx(Authorization, ISOCountryId, ISOCurrencyId); if ((buff != null) && buff.getClassCode().equals("ICCY")) { return ((CFSecurityISOCountryCurrencyBuff) buff); } else { return (null); } } public CFSecurityISOCountryCurrencyBuff[] readBuffByCountryIdx(CFSecurityAuthorization Authorization, short ISOCountryId) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readBuffByCountryIdx() "; CFSecurityISOCountryCurrencyBuff buff; ArrayList<CFSecurityISOCountryCurrencyBuff> filteredList = new ArrayList<CFSecurityISOCountryCurrencyBuff>(); CFSecurityISOCountryCurrencyBuff[] buffList = readDerivedByCountryIdx(Authorization, ISOCountryId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ICCY")) { filteredList.add((CFSecurityISOCountryCurrencyBuff) buff); } } return (filteredList.toArray(new CFSecurityISOCountryCurrencyBuff[0])); } public CFSecurityISOCountryCurrencyBuff[] readBuffByCurrencyIdx(CFSecurityAuthorization Authorization, short ISOCurrencyId) { final String S_ProcName = "CFSecurityRamISOCountryCurrency.readBuffByCurrencyIdx() "; CFSecurityISOCountryCurrencyBuff buff; ArrayList<CFSecurityISOCountryCurrencyBuff> filteredList = new ArrayList<CFSecurityISOCountryCurrencyBuff>(); CFSecurityISOCountryCurrencyBuff[] buffList = readDerivedByCurrencyIdx(Authorization, ISOCurrencyId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ICCY")) { filteredList.add((CFSecurityISOCountryCurrencyBuff) buff); } } return (filteredList.toArray(new CFSecurityISOCountryCurrencyBuff[0])); } public void updateISOCountryCurrency(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyBuff Buff) { CFSecurityISOCountryCurrencyPKey pkey = schema.getFactoryISOCountryCurrency().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId()); CFSecurityISOCountryCurrencyBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateISOCountryCurrency", "Existing record not found", "ISOCountryCurrency", pkey); } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateISOCountryCurrency", pkey); } Buff.setRequiredRevision(Buff.getRequiredRevision() + 1); CFSecurityISOCountryCurrencyByCountryIdxKey existingKeyCountryIdx = schema.getFactoryISOCountryCurrency() .newCountryIdxKey(); existingKeyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId()); CFSecurityISOCountryCurrencyByCountryIdxKey newKeyCountryIdx = schema.getFactoryISOCountryCurrency() .newCountryIdxKey(); newKeyCountryIdx.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); CFSecurityISOCountryCurrencyByCurrencyIdxKey existingKeyCurrencyIdx = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); existingKeyCurrencyIdx.setRequiredISOCurrencyId(existing.getRequiredISOCurrencyId()); CFSecurityISOCountryCurrencyByCurrencyIdxKey newKeyCurrencyIdx = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); newKeyCurrencyIdx.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableISOCountry().readDerivedByIdIdx(Authorization, Buff.getRequiredISOCountryId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateISOCountryCurrency", "Container", "ISOCountryCurrencyCountry", "ISOCountry", null); } } } // Update is valid SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> 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<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>(); dictByCountryIdx.put(newKeyCountryIdx, subdict); } subdict.put(pkey, Buff); subdict = dictByCurrencyIdx.get(existingKeyCurrencyIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByCurrencyIdx.containsKey(newKeyCurrencyIdx)) { subdict = dictByCurrencyIdx.get(newKeyCurrencyIdx); } else { subdict = new TreeMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff>(); dictByCurrencyIdx.put(newKeyCurrencyIdx, subdict); } subdict.put(pkey, Buff); } public void deleteISOCountryCurrency(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyBuff Buff) { final String S_ProcName = "CFSecurityRamISOCountryCurrencyTable.deleteISOCountryCurrency() "; CFSecurityISOCountryCurrencyPKey pkey = schema.getFactoryISOCountryCurrency().newPKey(); pkey.setRequiredISOCountryId(Buff.getRequiredISOCountryId()); pkey.setRequiredISOCurrencyId(Buff.getRequiredISOCurrencyId()); CFSecurityISOCountryCurrencyBuff existing = dictByPKey.get(pkey); if (existing == null) { return; } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteISOCountryCurrency", pkey); } CFSecurityISOCountryCurrencyByCountryIdxKey keyCountryIdx = schema.getFactoryISOCountryCurrency() .newCountryIdxKey(); keyCountryIdx.setRequiredISOCountryId(existing.getRequiredISOCountryId()); CFSecurityISOCountryCurrencyByCurrencyIdxKey keyCurrencyIdx = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); keyCurrencyIdx.setRequiredISOCurrencyId(existing.getRequiredISOCurrencyId()); // Validate reverse foreign keys // Delete is valid SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> subdict; dictByPKey.remove(pkey); subdict = dictByCountryIdx.get(keyCountryIdx); subdict.remove(pkey); subdict = dictByCurrencyIdx.get(keyCurrencyIdx); subdict.remove(pkey); } public void deleteISOCountryCurrencyByIdIdx(CFSecurityAuthorization Authorization, short argISOCountryId, short argISOCurrencyId) { CFSecurityISOCountryCurrencyPKey key = schema.getFactoryISOCountryCurrency().newPKey(); key.setRequiredISOCountryId(argISOCountryId); key.setRequiredISOCurrencyId(argISOCurrencyId); deleteISOCountryCurrencyByIdIdx(Authorization, key); } public void deleteISOCountryCurrencyByIdIdx(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyPKey argKey) { CFSecurityISOCountryCurrencyBuff cur; LinkedList<CFSecurityISOCountryCurrencyBuff> matchSet = new LinkedList<CFSecurityISOCountryCurrencyBuff>(); Iterator<CFSecurityISOCountryCurrencyBuff> values = dictByPKey.values().iterator(); while (values.hasNext()) { cur = values.next(); if (argKey.equals(cur)) { matchSet.add(cur); } } Iterator<CFSecurityISOCountryCurrencyBuff> iterMatch = matchSet.iterator(); while (iterMatch.hasNext()) { cur = iterMatch.next(); deleteISOCountryCurrency(Authorization, cur); } } public void deleteISOCountryCurrencyByCountryIdx(CFSecurityAuthorization Authorization, short argISOCountryId) { CFSecurityISOCountryCurrencyByCountryIdxKey key = schema.getFactoryISOCountryCurrency().newCountryIdxKey(); key.setRequiredISOCountryId(argISOCountryId); deleteISOCountryCurrencyByCountryIdx(Authorization, key); } public void deleteISOCountryCurrencyByCountryIdx(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyByCountryIdxKey argKey) { CFSecurityISOCountryCurrencyBuff cur; LinkedList<CFSecurityISOCountryCurrencyBuff> matchSet = new LinkedList<CFSecurityISOCountryCurrencyBuff>(); Iterator<CFSecurityISOCountryCurrencyBuff> values = dictByPKey.values().iterator(); while (values.hasNext()) { cur = values.next(); if (argKey.equals(cur)) { matchSet.add(cur); } } Iterator<CFSecurityISOCountryCurrencyBuff> iterMatch = matchSet.iterator(); while (iterMatch.hasNext()) { cur = iterMatch.next(); deleteISOCountryCurrency(Authorization, cur); } } public void deleteISOCountryCurrencyByCurrencyIdx(CFSecurityAuthorization Authorization, short argISOCurrencyId) { CFSecurityISOCountryCurrencyByCurrencyIdxKey key = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); key.setRequiredISOCurrencyId(argISOCurrencyId); deleteISOCountryCurrencyByCurrencyIdx(Authorization, key); } public void deleteISOCountryCurrencyByCurrencyIdx(CFSecurityAuthorization Authorization, CFSecurityISOCountryCurrencyByCurrencyIdxKey argKey) { CFSecurityISOCountryCurrencyBuff cur; LinkedList<CFSecurityISOCountryCurrencyBuff> matchSet = new LinkedList<CFSecurityISOCountryCurrencyBuff>(); Iterator<CFSecurityISOCountryCurrencyBuff> values = dictByPKey.values().iterator(); while (values.hasNext()) { cur = values.next(); if (argKey.equals(cur)) { matchSet.add(cur); } } Iterator<CFSecurityISOCountryCurrencyBuff> iterMatch = matchSet.iterator(); while (iterMatch.hasNext()) { cur = iterMatch.next(); deleteISOCountryCurrency(Authorization, cur); } } public CFSecurityCursor openISOCountryCurrencyCursorAll(CFSecurityAuthorization Authorization) { CFSecurityCursor cursor = new CFSecurityRamISOCountryCurrencyCursor(Authorization, schema, dictByPKey.values()); return (cursor); } public CFSecurityCursor openISOCountryCurrencyCursorByCountryIdx(CFSecurityAuthorization Authorization, short ISOCountryId) { CFSecurityCursor cursor; CFSecurityISOCountryCurrencyByCountryIdxKey key = schema.getFactoryISOCountryCurrency().newCountryIdxKey(); key.setRequiredISOCountryId(ISOCountryId); if (dictByCountryIdx.containsKey(key)) { SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> subdictCountryIdx = dictByCountryIdx .get(key); cursor = new CFSecurityRamISOCountryCurrencyCursor(Authorization, schema, subdictCountryIdx.values()); } else { cursor = new CFSecurityRamISOCountryCurrencyCursor(Authorization, schema, new ArrayList<CFSecurityISOCountryCurrencyBuff>()); } return (cursor); } public CFSecurityCursor openISOCountryCurrencyCursorByCurrencyIdx(CFSecurityAuthorization Authorization, short ISOCurrencyId) { CFSecurityCursor cursor; CFSecurityISOCountryCurrencyByCurrencyIdxKey key = schema.getFactoryISOCountryCurrency() .newCurrencyIdxKey(); key.setRequiredISOCurrencyId(ISOCurrencyId); if (dictByCurrencyIdx.containsKey(key)) { SortedMap<CFSecurityISOCountryCurrencyPKey, CFSecurityISOCountryCurrencyBuff> subdictCurrencyIdx = dictByCurrencyIdx .get(key); cursor = new CFSecurityRamISOCountryCurrencyCursor(Authorization, schema, subdictCurrencyIdx.values()); } else { cursor = new CFSecurityRamISOCountryCurrencyCursor(Authorization, schema, new ArrayList<CFSecurityISOCountryCurrencyBuff>()); } return (cursor); } public void closeISOCountryCurrencyCursor(CFSecurityCursor Cursor) { // Cursor.DataReader.Close(); } public CFSecurityISOCountryCurrencyBuff nextISOCountryCurrencyCursor(CFSecurityCursor Cursor) { CFSecurityRamISOCountryCurrencyCursor cursor = (CFSecurityRamISOCountryCurrencyCursor) Cursor; CFSecurityISOCountryCurrencyBuff rec = cursor.getCursor().next(); cursor.setRowIdx(cursor.getRowIdx() + 1); return (rec); } public CFSecurityISOCountryCurrencyBuff prevISOCountryCurrencyCursor(CFSecurityCursor Cursor) { int targetRowIdx = (Cursor.getRowIdx() > 1) ? Cursor.getRowIdx() - 1 : 1; CFSecurityISOCountryCurrencyBuff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextISOCountryCurrencyCursor(Cursor); } return (rec); } public CFSecurityISOCountryCurrencyBuff firstISOCountryCurrencyCursor(CFSecurityCursor Cursor) { int targetRowIdx = 1; CFSecurityISOCountryCurrencyBuff rec = null; Cursor.reset(); while (Cursor.getRowIdx() < targetRowIdx) { rec = nextISOCountryCurrencyCursor(Cursor); } return (rec); } public CFSecurityISOCountryCurrencyBuff lastISOCountryCurrencyCursor(CFSecurityCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotImplementedYetException(getClass(), "lastISOCountryCurrencyCursor"); } public CFSecurityISOCountryCurrencyBuff nthISOCountryCurrencyCursor(CFSecurityCursor Cursor, int Idx) { int targetRowIdx = Idx; CFSecurityISOCountryCurrencyBuff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextISOCountryCurrencyCursor(Cursor); } return (rec); } public void releasePreparedStatements() { } }