Java tutorial
// Description: Java6 in-memory RAM DbIO implementation for DelTopDep. /* * MSS Code Factory 1.11 * * Copyright (c) 2012-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/>. * * *********************************************************************** * * $Revision$ */ package net.sourceforge.msscodefactory.v1_11.MSSBamRam; 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.v1_11.MSSBam.*; import net.sourceforge.msscodefactory.v1_11.MSSBamBL.*; import net.sourceforge.msscodefactory.v1_11.MSSBamBLRam.*; /* * MSSBamRamDelTopDepTable in-memory RAM DbIO implementation * for DelTopDep. */ public class MSSBamRamDelTopDepTable implements IMSSBamDelTopDepTable { private MSSBamBLRamSchema schema; private Map<MSSBamAnyObjPKey, MSSBamDelTopDepBuff> dictByPKey = new HashMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff>(); private SortedMap<MSSBamDelTopDepByContTblIdxKey, SortedMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff>> dictByContTblIdx = new TreeMap<MSSBamDelTopDepByContTblIdxKey, SortedMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff>>(); public MSSBamRamDelTopDepTable(MSSBamBLRamSchema argSchema) { schema = argSchema; } public void createDelTopDep(MSSBamAuthorization Authorization, MSSBamDelTopDepBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setClassCode(Buff.getClassCode()); pkey.setRequiredId(Buff.getRequiredId()); MSSBamDelTopDepByContTblIdxKey keyContTblIdx = schema.getFactoryDelTopDep().newContTblIdxKey(); keyContTblIdx.setRequiredContTableId(Buff.getRequiredContTableId()); // Validate unique indexes if (dictByPKey.containsKey(pkey)) { throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createDelTopDep", pkey); } // Validate foreign keys { boolean allNull = true; allNull = false; if (!allNull) { if (null == schema.getTableDelDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "createDelTopDep", "Superclass", "SuperClass", "DelDep", null); } } } { boolean allNull = true; allNull = false; if (!allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredContTableId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "createDelTopDep", "Container", "ContTable", "Table", null); } } } // Proceed with adding the new record dictByPKey.put(pkey, Buff); SortedMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff> subdictContTblIdx; if (dictByContTblIdx.containsKey(keyContTblIdx)) { subdictContTblIdx = dictByContTblIdx.get(keyContTblIdx); } else { subdictContTblIdx = new TreeMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff>(); dictByContTblIdx.put(keyContTblIdx, subdictContTblIdx); } subdictContTblIdx.put(pkey, Buff); } public MSSBamDelTopDepBuff readDerived(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamDelTopDep.readDerived() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(PKey.getRequiredId()); MSSBamDelTopDepBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamDelTopDepBuff lockDerived(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamDelTopDep.readDerived() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(PKey.getRequiredId()); MSSBamDelTopDepBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamDelTopDepBuff[] readAllDerived(MSSBamAuthorization Authorization) { final String S_ProcName = "MSSBamRamDelTopDep.readAllDerived() "; MSSBamDelTopDepBuff[] retList = new MSSBamDelTopDepBuff[dictByPKey.values().size()]; Iterator<MSSBamDelTopDepBuff> iter = dictByPKey.values().iterator(); int idx = 0; while (iter.hasNext()) { retList[idx++] = iter.next(); } return (retList); } public MSSBamDelTopDepBuff[] readDerivedByTenantIdx(MSSBamAuthorization Authorization, long TenantId) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByTenantIdx() "; MSSBamAnyObjBuff buffList[] = schema.getTableAnyObj().readDerivedByTenantIdx(Authorization, TenantId); if (buffList == null) { return (null); } else { MSSBamAnyObjBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamDelTopDepBuff)) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } } public MSSBamDelTopDepBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByScopeIdx() "; MSSBamAnyObjBuff buffList[] = schema.getTableAnyObj().readDerivedByScopeIdx(Authorization, ScopeId); if (buffList == null) { return (null); } else { MSSBamAnyObjBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamDelTopDepBuff)) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } } public MSSBamDelTopDepBuff[] readDerivedByDefSchemaIdx(MSSBamAuthorization Authorization, Long DefSchemaId) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByDefSchemaIdx() "; MSSBamAnyObjBuff buffList[] = schema.getTableAnyObj().readDerivedByDefSchemaIdx(Authorization, DefSchemaId); if (buffList == null) { return (null); } else { MSSBamAnyObjBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamDelTopDepBuff)) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } } public MSSBamDelTopDepBuff[] readDerivedByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByAuthorIdx() "; MSSBamAnyObjBuff buffList[] = schema.getTableAnyObj().readDerivedByAuthorIdx(Authorization, AuthorId); if (buffList == null) { return (null); } else { MSSBamAnyObjBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamDelTopDepBuff)) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } } public MSSBamDelTopDepBuff readDerivedByUNameIdx(MSSBamAuthorization Authorization, Long ScopeId, String Name) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByUNameIdx() "; MSSBamAnyObjBuff buff = schema.getTableAnyObj().readDerivedByUNameIdx(Authorization, ScopeId, Name); if (buff == null) { return (null); } else if (buff instanceof MSSBamDelTopDepBuff) { return ((MSSBamDelTopDepBuff) buff); } else { return (null); } } public MSSBamDelTopDepBuff[] readDerivedByTableIdx(MSSBamAuthorization Authorization, long RelationId) { final String S_ProcName = "MSSBamRamDelDep.readDerivedByTableIdx() "; MSSBamDelDepBuff buffList[] = schema.getTableDelDep().readDerivedByTableIdx(Authorization, RelationId); if (buffList == null) { return (null); } else { MSSBamDelDepBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamDelTopDepBuff)) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } } public MSSBamDelTopDepBuff[] readDerivedByContTblIdx(MSSBamAuthorization Authorization, long ContTableId) { final String S_ProcName = "MSSBamRamDelTopDep.readDerivedByContTblIdx() "; MSSBamDelTopDepByContTblIdxKey key = schema.getFactoryDelTopDep().newContTblIdxKey(); key.setRequiredContTableId(ContTableId); MSSBamDelTopDepBuff[] recArray; if (dictByContTblIdx.containsKey(key)) { SortedMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff> subdictContTblIdx = dictByContTblIdx.get(key); recArray = new MSSBamDelTopDepBuff[subdictContTblIdx.size()]; Iterator<MSSBamDelTopDepBuff> iter = subdictContTblIdx.values().iterator(); int idx = 0; while (iter.hasNext()) { recArray[idx++] = iter.next(); } } else { recArray = new MSSBamDelTopDepBuff[0]; } return (recArray); } public MSSBamDelTopDepBuff readDerivedByIdIdx(MSSBamAuthorization Authorization, long Id) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByIdIdx() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(Id); MSSBamDelTopDepBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamDelTopDepBuff readBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamDelTopDep.readBuff() "; MSSBamDelTopDepBuff buff = readDerived(Authorization, PKey); if ((buff != null) && (!buff.getClassCode().equals("DELT"))) { buff = null; } return (buff); } public MSSBamDelTopDepBuff lockBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamDelTopDep.readBuff() "; MSSBamDelTopDepBuff buff = readDerived(Authorization, PKey); if ((buff != null) && (!buff.getClassCode().equals("DELT"))) { buff = null; } return (buff); } public MSSBamDelTopDepBuff[] readAllBuff(MSSBamAuthorization Authorization) { final String S_ProcName = "MSSBamRamDelTopDep.readAllBuff() "; MSSBamDelTopDepBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); MSSBamDelTopDepBuff[] buffList = readAllDerived(Authorization); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("DELT")) { filteredList.add(buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } public MSSBamDelTopDepBuff readBuffByIdIdx(MSSBamAuthorization Authorization, long Id) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByIdIdx() "; MSSBamAnyObjBuff buff = readDerivedByIdIdx(Authorization, Id); if ((buff != null) && buff.getClassCode().equals("ANYO")) { return ((MSSBamDelTopDepBuff) buff); } else { return (null); } } public MSSBamDelTopDepBuff[] readBuffByTenantIdx(MSSBamAuthorization Authorization, long TenantId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByTenantIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); MSSBamAnyObjBuff[] buffList = readDerivedByTenantIdx(Authorization, TenantId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ANYO")) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } public MSSBamDelTopDepBuff[] readBuffByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByScopeIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); MSSBamAnyObjBuff[] buffList = readDerivedByScopeIdx(Authorization, ScopeId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ANYO")) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } public MSSBamDelTopDepBuff[] readBuffByDefSchemaIdx(MSSBamAuthorization Authorization, Long DefSchemaId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByDefSchemaIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); MSSBamAnyObjBuff[] buffList = readDerivedByDefSchemaIdx(Authorization, DefSchemaId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ANYO")) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } public MSSBamDelTopDepBuff[] readBuffByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByAuthorIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); MSSBamAnyObjBuff[] buffList = readDerivedByAuthorIdx(Authorization, AuthorId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("ANYO")) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } public MSSBamDelTopDepBuff readBuffByUNameIdx(MSSBamAuthorization Authorization, Long ScopeId, String Name) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByUNameIdx() "; MSSBamAnyObjBuff buff = readDerivedByUNameIdx(Authorization, ScopeId, Name); if ((buff != null) && buff.getClassCode().equals("ANYO")) { return ((MSSBamDelTopDepBuff) buff); } else { return (null); } } public MSSBamDelTopDepBuff[] readBuffByTableIdx(MSSBamAuthorization Authorization, long RelationId) { final String S_ProcName = "MSSBamRamDelDep.readBuffByTableIdx() "; MSSBamDelDepBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); MSSBamDelDepBuff[] buffList = readDerivedByTableIdx(Authorization, RelationId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("DELD")) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } public MSSBamDelTopDepBuff[] readBuffByContTblIdx(MSSBamAuthorization Authorization, long ContTableId) { final String S_ProcName = "MSSBamRamDelTopDep.readBuffByContTblIdx() "; MSSBamDelTopDepBuff buff; ArrayList<MSSBamDelTopDepBuff> filteredList = new ArrayList<MSSBamDelTopDepBuff>(); MSSBamDelTopDepBuff[] buffList = readDerivedByContTblIdx(Authorization, ContTableId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("DELT")) { filteredList.add((MSSBamDelTopDepBuff) buff); } } return (filteredList.toArray(new MSSBamDelTopDepBuff[0])); } public void updateDelTopDep(MSSBamAuthorization Authorization, MSSBamDelTopDepBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamDelTopDepBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateDelTopDep", "Existing record not found", "DelTopDep", pkey); } MSSBamDelTopDepByContTblIdxKey existingKeyContTblIdx = schema.getFactoryDelTopDep().newContTblIdxKey(); existingKeyContTblIdx.setRequiredContTableId(existing.getRequiredContTableId()); MSSBamDelTopDepByContTblIdxKey newKeyContTblIdx = schema.getFactoryDelTopDep().newContTblIdxKey(); newKeyContTblIdx.setRequiredContTableId(Buff.getRequiredContTableId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableDelDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateDelTopDep", "Superclass", "SuperClass", "DelDep", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableTable().readDerivedByIdIdx(Authorization, Buff.getRequiredContTableId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateDelTopDep", "Container", "ContTable", "Table", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContTblIdx.get(existingKeyContTblIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByContTblIdx.containsKey(newKeyContTblIdx)) { subdict = dictByContTblIdx.get(newKeyContTblIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff>(); dictByContTblIdx.put(newKeyContTblIdx, subdict); } subdict.put(pkey, Buff); } public void deleteDelTopDep(MSSBamAuthorization Authorization, MSSBamDelTopDepBuff Buff) { final String S_ProcName = "MSSBamRamDelTopDepTable.deleteDelTopDep() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamDelTopDepBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteDelTopDep", "Existing record not found", "DelTopDep", pkey); } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteDelTopDep", pkey); } MSSBamDelTopDepByContTblIdxKey keyContTblIdx = schema.getFactoryDelTopDep().newContTblIdxKey(); keyContTblIdx.setRequiredContTableId(existing.getRequiredContTableId()); // Validate reverse foreign keys if (schema.getTableDelSubDep1().readDerivedByContDelTopIdx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteDelTopDep", "Container", "ContDelTopDep", "DelSubDep1", pkey); } // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContTblIdx.get(keyContTblIdx); subdict.remove(pkey); } public MSSBamCursor openDelTopDepCursorAll(MSSBamAuthorization Authorization) { MSSBamCursor cursor = new MSSBamRamDelTopDepCursor(Authorization, schema, dictByPKey.values()); return (cursor); } public MSSBamCursor openDelTopDepCursorByContTblIdx(MSSBamAuthorization Authorization, long ContTableId) { MSSBamCursor cursor; MSSBamDelTopDepByContTblIdxKey key = schema.getFactoryDelTopDep().newContTblIdxKey(); key.setRequiredContTableId(ContTableId); if (dictByContTblIdx.containsKey(key)) { SortedMap<MSSBamAnyObjPKey, MSSBamDelTopDepBuff> subdictContTblIdx = dictByContTblIdx.get(key); cursor = new MSSBamRamDelTopDepCursor(Authorization, schema, subdictContTblIdx.values()); } else { cursor = new MSSBamRamDelTopDepCursor(Authorization, schema, new ArrayList<MSSBamDelTopDepBuff>()); } return (cursor); } public void closeDelTopDepCursor(MSSBamCursor Cursor) { // Cursor.DataReader.Close(); } public MSSBamDelTopDepBuff nextDelTopDepCursor(MSSBamCursor Cursor) { MSSBamRamDelTopDepCursor cursor = (MSSBamRamDelTopDepCursor) Cursor; MSSBamDelTopDepBuff rec = cursor.getCursor().next(); cursor.setRowIdx(cursor.getRowIdx() + 1); return (rec); } public MSSBamDelTopDepBuff prevDelTopDepCursor(MSSBamCursor Cursor) { int targetRowIdx = (Cursor.getRowIdx() > 1) ? Cursor.getRowIdx() - 1 : 1; MSSBamDelTopDepBuff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextDelTopDepCursor(Cursor); } return (rec); } public MSSBamDelTopDepBuff firstDelTopDepCursor(MSSBamCursor Cursor) { int targetRowIdx = 1; MSSBamDelTopDepBuff rec = null; Cursor.reset(); while (Cursor.getRowIdx() < targetRowIdx) { rec = nextDelTopDepCursor(Cursor); } return (rec); } public MSSBamDelTopDepBuff lastDelTopDepCursor(MSSBamCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotImplementedYetException(getClass(), "lastDelTopDepCursor"); } public MSSBamDelTopDepBuff nthDelTopDepCursor(MSSBamCursor Cursor, int Idx) { int targetRowIdx = Idx; MSSBamDelTopDepBuff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextDelTopDepCursor(Cursor); } return (rec); } }