Java tutorial
// Description: Java6 in-memory RAM DbIO implementation for SchemaTZDate. /* * MSS Code Factory 1.10 * * Copyright (c) 2012 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/>. * * *********************************************************************** * * Code manufactured * by MSS Code Factory version 1.9.3294 * * $Revision: 26 $ */ package net.sourceforge.msscodefactory.v1_10.MSSBamRam; import java.sql.*; import java.util.*; import net.sourceforge.msscodefactory.cflib.v1_9.CFLib.*; import org.apache.commons.codec.binary.Base64; import net.sourceforge.msscodefactory.v1_10.MSSBam.*; import net.sourceforge.msscodefactory.v1_10.MSSBamBL.*; import net.sourceforge.msscodefactory.v1_10.MSSBamBLRam.*; /* * MSSBamRamSchemaTZDateTable in-memory RAM DbIO implementation * for SchemaTZDate. */ public class MSSBamRamSchemaTZDateTable implements IMSSBamSchemaTZDateTable { private MSSBamBLRamSchema schema; private Map<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff> dictByPKey = new HashMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff>(); private SortedMap<MSSBamSchemaTZDateByContainerIdxKey, SortedMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff>> dictByContainerIdx = new TreeMap<MSSBamSchemaTZDateByContainerIdxKey, SortedMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff>>(); public MSSBamRamSchemaTZDateTable(MSSBamBLRamSchema argSchema) { schema = argSchema; } public void createSchemaTZDate(MSSBamAuthorization Authorization, MSSBamSchemaTZDateBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setClassCode(Buff.getClassCode()); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaTZDateByContainerIdxKey keyContainerIdx = schema.getFactorySchemaTZDate().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Validate unique indexes if (dictByPKey.containsKey(pkey)) { throw CFLib.getDefaultExceptionFactory().newPrimaryKeyNotNewException(getClass(), "createSchemaTZDate", pkey); } // Validate foreign keys { boolean allNull = true; allNull = false; if (!allNull) { if (null == schema.getTableTZDateDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "createSchemaTZDate", "Superclass", "SuperClass", "TZDateDef", null); } } } { boolean allNull = true; allNull = false; if (!allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "createSchemaTZDate", "Container", "CSchema", "SchemaDef", null); } } } // Proceed with adding the new record dictByPKey.put(pkey, Buff); SortedMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff> subdictContainerIdx; if (dictByContainerIdx.containsKey(keyContainerIdx)) { subdictContainerIdx = dictByContainerIdx.get(keyContainerIdx); } else { subdictContainerIdx = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff>(); dictByContainerIdx.put(keyContainerIdx, subdictContainerIdx); } subdictContainerIdx.put(pkey, Buff); } public MSSBamSchemaTZDateBuff readDerived(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamSchemaTZDate.readDerived() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(PKey.getRequiredId()); MSSBamSchemaTZDateBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamSchemaTZDateBuff[] readAllDerived(MSSBamAuthorization Authorization) { final String S_ProcName = "MSSBamRamSchemaTZDate.readAllDerived() "; MSSBamSchemaTZDateBuff[] retList = new MSSBamSchemaTZDateBuff[dictByPKey.values().size()]; Iterator<MSSBamSchemaTZDateBuff> iter = dictByPKey.values().iterator(); int idx = 0; while (iter.hasNext()) { retList[idx++] = iter.next(); } return (retList); } public MSSBamSchemaTZDateBuff[] 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<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] 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<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] 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<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff 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 MSSBamSchemaTZDateBuff) { return ((MSSBamSchemaTZDateBuff) buff); } else { return (null); } } public MSSBamSchemaTZDateBuff[] readDerivedByVContIdx(MSSBamAuthorization Authorization, long ValueContainerId) { final String S_ProcName = "MSSBamRamValue.readDerivedByVContIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByVContIdx(Authorization, ValueContainerId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByDataScopeIdx(MSSBamAuthorization Authorization, Short DataScopeId) { final String S_ProcName = "MSSBamRamValue.readDerivedByDataScopeIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByDataScopeIdx(Authorization, DataScopeId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByVAccSecIdx(MSSBamAuthorization Authorization, Short ViewAccessSecurityId) { final String S_ProcName = "MSSBamRamValue.readDerivedByVAccSecIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByVAccSecIdx(Authorization, ViewAccessSecurityId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByVAccFreqIdx(MSSBamAuthorization Authorization, Short ViewAccessFrequencyId) { final String S_ProcName = "MSSBamRamValue.readDerivedByVAccFreqIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByVAccFreqIdx(Authorization, ViewAccessFrequencyId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByEAccSecIdx(MSSBamAuthorization Authorization, Short EditAccessSecurityId) { final String S_ProcName = "MSSBamRamValue.readDerivedByEAccSecIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByEAccSecIdx(Authorization, EditAccessSecurityId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByEAccFreqIdx(MSSBamAuthorization Authorization, Short EditAccessFrequencyId) { final String S_ProcName = "MSSBamRamValue.readDerivedByEAccFreqIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByEAccFreqIdx(Authorization, EditAccessFrequencyId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByPrevIdx(MSSBamAuthorization Authorization, Long PrevId) { final String S_ProcName = "MSSBamRamValue.readDerivedByPrevIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByPrevIdx(Authorization, PrevId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByNextIdx(MSSBamAuthorization Authorization, Long NextId) { final String S_ProcName = "MSSBamRamValue.readDerivedByNextIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByNextIdx(Authorization, NextId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByContPrevIdx(MSSBamAuthorization Authorization, long ValueContainerId, Long PrevId) { final String S_ProcName = "MSSBamRamValue.readDerivedByContPrevIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByContPrevIdx(Authorization, ValueContainerId, PrevId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByContNextIdx(MSSBamAuthorization Authorization, long ValueContainerId, Long NextId) { final String S_ProcName = "MSSBamRamValue.readDerivedByContNextIdx() "; MSSBamValueBuff buffList[] = schema.getTableValue().readDerivedByContNextIdx(Authorization, ValueContainerId, NextId); if (buffList == null) { return (null); } else { MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && (buff instanceof MSSBamSchemaTZDateBuff)) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } } public MSSBamSchemaTZDateBuff[] readDerivedByContainerIdx(MSSBamAuthorization Authorization, long ContainerId) { final String S_ProcName = "MSSBamRamSchemaTZDate.readDerivedByContainerIdx() "; MSSBamSchemaTZDateByContainerIdxKey key = schema.getFactorySchemaTZDate().newContainerIdxKey(); key.setRequiredContainerId(ContainerId); MSSBamSchemaTZDateBuff[] recArray; if (dictByContainerIdx.containsKey(key)) { SortedMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff> subdictContainerIdx = dictByContainerIdx.get(key); recArray = new MSSBamSchemaTZDateBuff[subdictContainerIdx.size()]; Iterator<MSSBamSchemaTZDateBuff> iter = subdictContainerIdx.values().iterator(); int idx = 0; while (iter.hasNext()) { recArray[idx++] = iter.next(); } } else { recArray = new MSSBamSchemaTZDateBuff[0]; } return (recArray); } public MSSBamSchemaTZDateBuff readDerivedByIdIdx(MSSBamAuthorization Authorization, long Id) { final String S_ProcName = "MSSBamRamAnyObj.readDerivedByIdIdx() "; MSSBamAnyObjPKey key = schema.getFactoryAnyObj().newPKey(); key.setRequiredId(Id); MSSBamSchemaTZDateBuff buff; if (dictByPKey.containsKey(key)) { buff = dictByPKey.get(key); } else { buff = null; } return (buff); } public MSSBamSchemaTZDateBuff readBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) { final String S_ProcName = "MSSBamRamSchemaTZDate.readBuff() "; MSSBamSchemaTZDateBuff buff = readDerived(Authorization, PKey); if ((buff != null) && (!buff.getClassCode().equals("SZDY"))) { buff = null; } return (buff); } public MSSBamSchemaTZDateBuff[] readAllBuff(MSSBamAuthorization Authorization) { final String S_ProcName = "MSSBamRamSchemaTZDate.readAllBuff() "; MSSBamSchemaTZDateBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamSchemaTZDateBuff[] buffList = readAllDerived(Authorization); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("SZDY")) { filteredList.add(buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff readBuffByIdIdx(MSSBamAuthorization Authorization, long Id) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByIdIdx() "; MSSBamAnyObjBuff buff = readDerivedByIdIdx(Authorization, Id); if ((buff != null) && buff.getClassCode().equals("ANYO")) { return ((MSSBamSchemaTZDateBuff) buff); } else { return (null); } } public MSSBamSchemaTZDateBuff[] readBuffByTenantIdx(MSSBamAuthorization Authorization, long TenantId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByTenantIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); 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((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByScopeIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); 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((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) { final String S_ProcName = "MSSBamRamAnyObj.readBuffByAuthorIdx() "; MSSBamAnyObjBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); 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((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff 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 ((MSSBamSchemaTZDateBuff) buff); } else { return (null); } } public MSSBamSchemaTZDateBuff[] readBuffByVContIdx(MSSBamAuthorization Authorization, long ValueContainerId) { final String S_ProcName = "MSSBamRamValue.readBuffByVContIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByVContIdx(Authorization, ValueContainerId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByDataScopeIdx(MSSBamAuthorization Authorization, Short DataScopeId) { final String S_ProcName = "MSSBamRamValue.readBuffByDataScopeIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByDataScopeIdx(Authorization, DataScopeId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByVAccSecIdx(MSSBamAuthorization Authorization, Short ViewAccessSecurityId) { final String S_ProcName = "MSSBamRamValue.readBuffByVAccSecIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByVAccSecIdx(Authorization, ViewAccessSecurityId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByVAccFreqIdx(MSSBamAuthorization Authorization, Short ViewAccessFrequencyId) { final String S_ProcName = "MSSBamRamValue.readBuffByVAccFreqIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByVAccFreqIdx(Authorization, ViewAccessFrequencyId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByEAccSecIdx(MSSBamAuthorization Authorization, Short EditAccessSecurityId) { final String S_ProcName = "MSSBamRamValue.readBuffByEAccSecIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByEAccSecIdx(Authorization, EditAccessSecurityId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByEAccFreqIdx(MSSBamAuthorization Authorization, Short EditAccessFrequencyId) { final String S_ProcName = "MSSBamRamValue.readBuffByEAccFreqIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByEAccFreqIdx(Authorization, EditAccessFrequencyId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByPrevIdx(MSSBamAuthorization Authorization, Long PrevId) { final String S_ProcName = "MSSBamRamValue.readBuffByPrevIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByPrevIdx(Authorization, PrevId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByNextIdx(MSSBamAuthorization Authorization, Long NextId) { final String S_ProcName = "MSSBamRamValue.readBuffByNextIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByNextIdx(Authorization, NextId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByContPrevIdx(MSSBamAuthorization Authorization, long ValueContainerId, Long PrevId) { final String S_ProcName = "MSSBamRamValue.readBuffByContPrevIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByContPrevIdx(Authorization, ValueContainerId, PrevId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByContNextIdx(MSSBamAuthorization Authorization, long ValueContainerId, Long NextId) { final String S_ProcName = "MSSBamRamValue.readBuffByContNextIdx() "; MSSBamValueBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamValueBuff[] buffList = readDerivedByContNextIdx(Authorization, ValueContainerId, NextId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("VAL")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public MSSBamSchemaTZDateBuff[] readBuffByContainerIdx(MSSBamAuthorization Authorization, long ContainerId) { final String S_ProcName = "MSSBamRamSchemaTZDate.readBuffByContainerIdx() "; MSSBamSchemaTZDateBuff buff; ArrayList<MSSBamSchemaTZDateBuff> filteredList = new ArrayList<MSSBamSchemaTZDateBuff>(); MSSBamSchemaTZDateBuff[] buffList = readDerivedByContainerIdx(Authorization, ContainerId); for (int idx = 0; idx < buffList.length; idx++) { buff = buffList[idx]; if ((buff != null) && buff.getClassCode().equals("SZDY")) { filteredList.add((MSSBamSchemaTZDateBuff) buff); } } return (filteredList.toArray(new MSSBamSchemaTZDateBuff[0])); } public void updateSchemaTZDate(MSSBamAuthorization Authorization, MSSBamSchemaTZDateBuff Buff) { MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(Buff.getRequiredId()); MSSBamSchemaTZDateBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateSchemaTZDate", "Existing record not found", "SchemaTZDate", pkey); } MSSBamSchemaTZDateByContainerIdxKey existingKeyContainerIdx = schema.getFactorySchemaTZDate() .newContainerIdxKey(); existingKeyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); MSSBamSchemaTZDateByContainerIdxKey newKeyContainerIdx = schema.getFactorySchemaTZDate() .newContainerIdxKey(); newKeyContainerIdx.setRequiredContainerId(Buff.getRequiredContainerId()); // Check unique indexes // Validate foreign keys { boolean allNull = true; if (allNull) { if (null == schema.getTableTZDateDef().readDerivedByIdIdx(Authorization, Buff.getRequiredId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaTZDate", "Superclass", "SuperClass", "TZDateDef", null); } } } { boolean allNull = true; if (allNull) { if (null == schema.getTableSchemaDef().readDerivedByIdIdx(Authorization, Buff.getRequiredContainerId())) { throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateSchemaTZDate", "Container", "CSchema", "SchemaDef", null); } } } // Update is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff> subdict; dictByPKey.remove(pkey); dictByPKey.put(pkey, Buff); subdict = dictByContainerIdx.get(existingKeyContainerIdx); if (subdict != null) { subdict.remove(pkey); } if (dictByContainerIdx.containsKey(newKeyContainerIdx)) { subdict = dictByContainerIdx.get(newKeyContainerIdx); } else { subdict = new TreeMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff>(); dictByContainerIdx.put(newKeyContainerIdx, subdict); } subdict.put(pkey, Buff); } public void deleteSchemaTZDate(MSSBamAuthorization Authorization, MSSBamSchemaTZDateBuff Buff) { final String S_ProcName = "MSSBamRamSchemaTZDateTable.deleteSchemaTZDate() "; MSSBamAnyObjPKey pkey = schema.getFactoryAnyObj().newPKey(); pkey.setRequiredId(schema.nextAnyObjIdGen()); MSSBamSchemaTZDateBuff existing = dictByPKey.get(pkey); if (existing == null) { throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "deleteSchemaTZDate", "Existing record not found", "SchemaTZDate", pkey); } if (existing.getRequiredRevision() != Buff.getRequiredRevision()) { throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSchemaTZDate", pkey); } MSSBamSchemaTZDateByContainerIdxKey keyContainerIdx = schema.getFactorySchemaTZDate().newContainerIdxKey(); keyContainerIdx.setRequiredContainerId(existing.getRequiredContainerId()); // Validate reverse foreign keys // Delete is valid SortedMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff> subdict; dictByPKey.remove(pkey); subdict = dictByContainerIdx.get(keyContainerIdx); subdict.remove(pkey); } public MSSBamCursor openSchemaTZDateCursorAll(MSSBamAuthorization Authorization) { MSSBamCursor cursor = new MSSBamRamSchemaTZDateCursor(Authorization, schema, dictByPKey.values()); return (cursor); } public MSSBamCursor openSchemaTZDateCursorByContainerIdx(MSSBamAuthorization Authorization, long ContainerId) { MSSBamCursor cursor; MSSBamSchemaTZDateByContainerIdxKey key = schema.getFactorySchemaTZDate().newContainerIdxKey(); key.setRequiredContainerId(ContainerId); if (dictByContainerIdx.containsKey(key)) { SortedMap<MSSBamAnyObjPKey, MSSBamSchemaTZDateBuff> subdictContainerIdx = dictByContainerIdx.get(key); cursor = new MSSBamRamSchemaTZDateCursor(Authorization, schema, subdictContainerIdx.values()); } else { cursor = new MSSBamRamSchemaTZDateCursor(Authorization, schema, new ArrayList<MSSBamSchemaTZDateBuff>()); } return (cursor); } public void closeSchemaTZDateCursor(MSSBamCursor Cursor) { // Cursor.DataReader.Close(); } public MSSBamSchemaTZDateBuff nextSchemaTZDateCursor(MSSBamCursor Cursor) { MSSBamRamSchemaTZDateCursor cursor = (MSSBamRamSchemaTZDateCursor) Cursor; MSSBamSchemaTZDateBuff rec = cursor.getCursor().next(); cursor.setRowIdx(cursor.getRowIdx() + 1); return (rec); } public MSSBamSchemaTZDateBuff prevSchemaTZDateCursor(MSSBamCursor Cursor) { int targetRowIdx = (Cursor.getRowIdx() > 1) ? Cursor.getRowIdx() - 1 : 1; MSSBamSchemaTZDateBuff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextSchemaTZDateCursor(Cursor); } return (rec); } public MSSBamSchemaTZDateBuff firstSchemaTZDateCursor(MSSBamCursor Cursor) { int targetRowIdx = 1; MSSBamSchemaTZDateBuff rec = null; Cursor.reset(); while (Cursor.getRowIdx() < targetRowIdx) { rec = nextSchemaTZDateCursor(Cursor); } return (rec); } public MSSBamSchemaTZDateBuff lastSchemaTZDateCursor(MSSBamCursor Cursor) { throw CFLib.getDefaultExceptionFactory().newNotImplementedYetException(getClass(), "lastSchemaTZDateCursor"); } public MSSBamSchemaTZDateBuff nthSchemaTZDateCursor(MSSBamCursor Cursor, int Idx) { int targetRowIdx = Idx; MSSBamSchemaTZDateBuff rec = null; if (Cursor.getRowIdx() >= targetRowIdx) { Cursor.reset(); } while (Cursor.getRowIdx() < targetRowIdx) { rec = nextSchemaTZDateCursor(Cursor); } return (rec); } }