Java tutorial
// Description: Java6 in-memory RAM DbIO implementation for ClearSubDep2. /* * 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.*; /* * MSSBamRamClearSubDep2Table in-memory RAM DbIO implementation * for ClearSubDep2. */ public class MSSBamRamClearSubDep2Table implements IMSSBamClearSubDep2Table { private MSSBamBLRamSchema schema; private Map<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff> dictByPKey = new HashMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff>(); private SortedMap<MSSBamClearSubDep2ByContClearDep1IdxKey, SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff>> dictByContClearDep1Idx = new TreeMap<MSSBamClearSubDep2ByContClearDep1IdxKey, SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff>>(); public MSSBamRamClearSubDep2Table(MSSBamBLRamSchema argSchema) { schema = argSchema; } public void createClearSubDep2(MSSBamAuthorization Authorization, MSSBamClearSubDep2Buff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setClassCode(Buff.getClassCode()); pkey.setRequiredId(Buff.getRequiredId()); MSSBamClearSubDep2ByContClearDep1IdxKey keyContClearDep1Idx = schema.getFactoryClearSubDep2() .newContClearDep1IdxKey(); keyContClearDep1Idx.setRequiredContClearDep1Id(Buff.getRequiredContClearDep1Id()); // Validate unique indexes if (dictByPKey.containsKey(pkey)) { throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createClearSubDep2", pkey); } // Validate foreign keys { boolean allNull = true; allNull = false; if (!allNull) { if (null == schema.getTableClearDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "createClearSubDep2", "Superclass", "SuperClass", "ClearDep", null); } } } { boolean allNull = true; allNull = false; if (!allNull) { if (null == schema.getTableClearSubDep1().readDerivedByIdIdx(Authorization, Buff.getRequiredContClearDep1Id())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "createClearSubDep2", "Container", "ContClearSubDep1", "ClearSubDep1", null); } } } // Proceed with adding the new record dictByPKey.put(pkey, Buff); SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff> subdictContClearDep1Idx; if (dictByContClearDep1Idx.containsKey(keyContClearDep1Idx)) { subdictContClearDep1Idx = dictByContClearDep1Idx.get(keyContClearDep1Idx); } else { subdictContClearDep1Idx = new TreeMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff>(); dictByContClearDep1Idx.put(keyContClearDep1Idx, subdictContClearDep1Idx); } subdictContClearDep1Idx.put(pkey, Buff); } public MSSBamClearSubDep2Buff readDerived(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamClearSubDep2.readDerived() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(PKey.getRequiredId()); MSSBamClearSubDep2Buff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamClearSubDep2Buff lockDerived(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamClearSubDep2.readDerived() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(PKey.getRequiredId()); MSSBamClearSubDep2Buff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamClearSubDep2Buff[] readAllDerived(MSSBamAuthorization Authorization) { final String S_ProcName = "MSSBamRamClearSubDep2.readAllDerived() "; MSSBamClearSubDep2Buff[] retList = new MSSBamClearSubDep2Buff[dictByPKey.values().size()]; Iterator<MSSBamClearSubDep2Buff> iter = dictByPKey.values().iterator(); int idx = 0; while (iter.hasNext()) { retList[idx++] = iter.next(); } return (retList); } public MSSBamClearSubDep2Buff[] 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<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearSubDep2Buff)) { filteredList.add((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } } public MSSBamClearSubDep2Buff[] 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<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearSubDep2Buff)) { filteredList.add((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } } public MSSBamClearSubDep2Buff[] 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<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearSubDep2Buff)) { filteredList.add((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } } public MSSBamClearSubDep2Buff[] 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<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearSubDep2Buff)) { filteredList.add((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } } public MSSBamClearSubDep2Buff 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 MSSBamClearSubDep2Buff) { return ((MSSBamClearSubDep2Buff) buff); } else { return (null); } } public MSSBamClearSubDep2Buff[] readDerivedByTableIdx(MSSBamAuthorization Authorization, long RelationId) { final String S_ProcName = "MSSBamRamClearDep.readDerivedByTableIdx() "; MSSBamClearDepBuff buffList[] = schema.getTableClearDep().readDerivedByTableIdx(Authorization, RelationId); if (buffList == null) { return (null); } else { MSSBamClearDepBuff buff; ArrayList<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamClearSubDep2Buff)) { filteredList.add((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } } public MSSBamClearSubDep2Buff[] readDerivedByContClearDep1Idx(MSSBamAuthorization Authorization, long ContClearDep1Id) { final String S_ProcName = "MSSBamRamClearSubDep2.readDerivedByContClearDep1Idx() "; MSSBamClearSubDep2ByContClearDep1IdxKey key = schema.getFactoryClearSubDep2().newContClearDep1IdxKey(); key.setRequiredContClearDep1Id(ContClearDep1Id); MSSBamClearSubDep2Buff[] recArray; if (dictByContClearDep1Idx.containsKey(key)) { SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff> subdictContClearDep1Idx = dictByContClearDep1Idx .get(key); recArray = new MSSBamClearSubDep2Buff[subdictContClearDep1Idx.size()]; Iterator<MSSBamClearSubDep2Buff> iter = subdictContClearDep1Idx.values().iterator(); int idx = 0; while (iter.hasNext()) { recArray[idx++] = iter.next(); } } else { recArray = new MSSBamClearSubDep2Buff[0]; } return (recArray); } public MSSBamClearSubDep2Buff readDerivedByIdIdx(MSSBamAuthorization Authorization, long Id) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByIdIdx() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(Id); MSSBamClearSubDep2Buff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamClearSubDep2Buff readBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamClearSubDep2.readBuff() "; MSSBamClearSubDep2Buff buff = readDerived(Authorization, PKey); if ((buff != null) && (!buff.getClassCode().equals("CLR2"))) { buff = null; } return (buff); } public MSSBamClearSubDep2Buff lockBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamClearSubDep2.readBuff() "; MSSBamClearSubDep2Buff buff = readDerived(Authorization, PKey); if ((buff != null) && (!buff.getClassCode().equals("CLR2"))) { buff = null; } return (buff); } public MSSBamClearSubDep2Buff[] readAllBuff(MSSBamAuthorization Authorization) { final String S_ProcName = "MSSBamRamClearSubDep2.readAllBuff() "; MSSBamClearSubDep2Buff buff; ArrayList<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); MSSBamClearSubDep2Buff[] buffList = readAllDerived(Authorization); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("CLR2")) { filteredList.add(buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } public MSSBamClearSubDep2Buff readBuffByIdIdx(MSSBamAuthorization Authorization, long Id) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByIdIdx() "; MSSBamAnyObjBuff buff = readDerivedByIdIdx(Authorization, Id); if ((buff != null) && buff.getClassCode().equals("ANYO")) { return ((MSSBamClearSubDep2Buff) buff); } else { return (null); } } public MSSBamClearSubDep2Buff[] readBuffByTenantIdx(MSSBamAuthorization Authorization, long TenantId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByTenantIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); 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((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } public MSSBamClearSubDep2Buff[] readBuffByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByScopeIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); 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((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } public MSSBamClearSubDep2Buff[] readBuffByDefSchemaIdx(MSSBamAuthorization Authorization, Long DefSchemaId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByDefSchemaIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); 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((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } public MSSBamClearSubDep2Buff[] readBuffByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByAuthorIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); 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((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } public MSSBamClearSubDep2Buff 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 ((MSSBamClearSubDep2Buff) buff); } else { return (null); } } public MSSBamClearSubDep2Buff[] readBuffByTableIdx(MSSBamAuthorization Authorization, long RelationId) { final String S_ProcName = "MSSBamRamClearDep.readBuffByTableIdx() "; MSSBamClearDepBuff buff; ArrayList<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); MSSBamClearDepBuff[] buffList = readDerivedByTableIdx(Authorization, RelationId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("CLRD")) { filteredList.add((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } public MSSBamClearSubDep2Buff[] readBuffByContClearDep1Idx(MSSBamAuthorization Authorization, long ContClearDep1Id) { final String S_ProcName = "MSSBamRamClearSubDep2.readBuffByContClearDep1Idx() "; MSSBamClearSubDep2Buff buff; ArrayList<MSSBamClearSubDep2Buff> filteredList = new ArrayList<MSSBamClearSubDep2Buff>(); MSSBamClearSubDep2Buff[] buffList = readDerivedByContClearDep1Idx(Authorization, ContClearDep1Id); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("CLR2")) { filteredList.add((MSSBamClearSubDep2Buff) buff); } } return (filteredList.toArray(new MSSBamClearSubDep2Buff[0])); } public void updateClearSubDep2(MSSBamAuthorization Authorization, MSSBamClearSubDep2Buff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamClearSubDep2Buff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateClearSubDep2", "Existing record not found", "ClearSubDep2", pkey); } MSSBamClearSubDep2ByContClearDep1IdxKey existingKeyContClearDep1Idx = schema.getFactoryClearSubDep2() .newContClearDep1IdxKey(); existingKeyContClearDep1Idx.setRequiredContClearDep1Id(existing.getRequiredContClearDep1Id()); MSSBamClearSubDep2ByContClearDep1IdxKey newKeyContClearDep1Idx = schema.getFactoryClearSubDep2() .newContClearDep1IdxKey(); newKeyContClearDep1Idx.setRequiredContClearDep1Id(Buff.getRequiredContClearDep1Id()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableClearDep().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateClearSubDep2", "Superclass", "SuperClass", "ClearDep", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableClearSubDep1().readDerivedByIdIdx(Authorization, Buff.getRequiredContClearDep1Id())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateClearSubDep2", "Container", "ContClearSubDep1", "ClearSubDep1", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContClearDep1Idx.get(existingKeyContClearDep1Idx); if (subdict != null) { subdict.remove(pkey); } if (dictByContClearDep1Idx.containsKey(newKeyContClearDep1Idx)) { subdict = dictByContClearDep1Idx.get(newKeyContClearDep1Idx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff>(); dictByContClearDep1Idx.put(newKeyContClearDep1Idx, subdict); } subdict.put(pkey, Buff); } public void deleteClearSubDep2(MSSBamAuthorization Authorization, MSSBamClearSubDep2Buff Buff) { final String S_ProcName = "MSSBamRamClearSubDep2Table.deleteClearSubDep2() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamClearSubDep2Buff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteClearSubDep2", "Existing record not found", "ClearSubDep2", pkey); } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteClearSubDep2", pkey); } MSSBamClearSubDep2ByContClearDep1IdxKey keyContClearDep1Idx = schema.getFactoryClearSubDep2() .newContClearDep1IdxKey(); keyContClearDep1Idx.setRequiredContClearDep1Id(existing.getRequiredContClearDep1Id()); // Validate reverse foreign keys if (schema.getTableClearSubDep3().readDerivedByContClearDep2Idx(Authorization, existing.getRequiredId()).length > 0) { throw CFLib.getDefaultExceptionFactory().newDependentsDetectedException(getClass(), "deleteClearSubDep2", "Container", "ContClearSubDep3", "ClearSubDep3", pkey); } // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff> subdict; dictByPKey.remove(pkey); subdict = dictByContClearDep1Idx.get(keyContClearDep1Idx); subdict.remove(pkey); } public MSSBamCursor openClearSubDep2CursorAll(MSSBamAuthorization Authorization) { MSSBamCursor cursor = new MSSBamRamClearSubDep2Cursor(Authorization, schema, dictByPKey.values()); return (cursor); } public MSSBamCursor openClearSubDep2CursorByContClearDep1Idx(MSSBamAuthorization Authorization, long ContClearDep1Id) { MSSBamCursor cursor; MSSBamClearSubDep2ByContClearDep1IdxKey key = schema.getFactoryClearSubDep2().newContClearDep1IdxKey(); key.setRequiredContClearDep1Id(ContClearDep1Id); if (dictByContClearDep1Idx.containsKey(key)) { SortedMap<MSSBamAnyObjPKey, MSSBamClearSubDep2Buff> subdictContClearDep1Idx = dictByContClearDep1Idx .get(key); cursor = new MSSBamRamClearSubDep2Cursor(Authorization, schema, subdictContClearDep1Idx.values()); } else { cursor = new MSSBamRamClearSubDep2Cursor(Authorization, schema, new ArrayList<MSSBamClearSubDep2Buff>()); } return (cursor); } public void closeClearSubDep2Cursor(MSSBamCursor Cursor) { // Cursor.DataReader.Close(); } public MSSBamClearSubDep2Buff nextClearSubDep2Cursor(MSSBamCursor Cursor) { MSSBamRamClearSubDep2Cursor cursor = (MSSBamRamClearSubDep2Cursor) Cursor; MSSBamClearSubDep2Buff rec = cursor.getCursor().next(); cursor.setRowIdx(cursor.getRowIdx() + 1); return (rec); } public MSSBamClearSubDep2Buff prevClearSubDep2Cursor(MSSBamCursor Cursor) { int targetRowIdx = (Cursor.getRowIdx() > 1) ? Cursor.getRowIdx() - 1 : 1; MSSBamClearSubDep2Buff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextClearSubDep2Cursor(Cursor); } return (rec); } public MSSBamClearSubDep2Buff firstClearSubDep2Cursor(MSSBamCursor Cursor) { int targetRowIdx = 1; MSSBamClearSubDep2Buff rec = null; Cursor.reset(); while (Cursor.getRowIdx() < targetRowIdx) { rec = nextClearSubDep2Cursor(Cursor); } return (rec); } public MSSBamClearSubDep2Buff lastClearSubDep2Cursor(MSSBamCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotImplementedYetException(getClass(), "lastClearSubDep2Cursor"); } public MSSBamClearSubDep2Buff nthClearSubDep2Cursor(MSSBamCursor Cursor, int Idx) { int targetRowIdx = Idx; MSSBamClearSubDep2Buff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextClearSubDep2Cursor(Cursor); } return (rec); } }