net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8AtomDefTable.java Source code

Java tutorial

Introduction

Here is the source code for net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8AtomDefTable.java

Source

// Description: Java 6 PostgreSQL Jdbc DbIO implementation for AtomDef.

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

import java.math.*;
import java.sql.*;
import java.text.*;
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.*;

/*
 *   MSSBamPg8AtomDefTable PostgreSQL Jdbc DbIO implementation
 *   for AtomDef.
 *
 *   Data redaction is the responsibility of another layer.  The raw database
 *   interface returns everything regardless of whether the end user is
 *   authorized to see the data.  A redaction layer replaces protected/redacted
 *   buffs with default values.  They should not be included in client-side
 *   filter sets, and the network redaction layer should actually eliminate them
 *   before transmitting data to the client.  The client should never see
 *   redacted data in order to comply with data privacy regulations in Canada
 *   and the US.
 */
public class MSSBamPg8AtomDefTable implements IMSSBamAtomDefTable {
    private MSSBamPg8Schema schema;

    public MSSBamPg8AtomDefTable(MSSBamPg8Schema argSchema) {
        schema = argSchema;
    }

    public void createAtomDef(MSSBamAuthorization Authorization, MSSBamAtomDefBuff Buff) {
        final String S_ProcName = "createAtomDef ";
        try {
            Connection cnx = schema.getCnx();
            long Id = Buff.getRequiredId();
            String DbName = Buff.getOptionalDbName();
            String sql = "INSERT INTO mssbam110.atom_def( " + "id, " + "dbname" + " )" + "VALUES ( " + Id + ", "
                    + MSSBamPg8Schema.getQuotedString(DbName) + " )";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            int rowsAffected = stmt.executeUpdate(sql);
            if (rowsAffected != 1) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Expected 1 row to be affected by insert, not " + rowsAffected);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public final static String S_sqlSelectAtomDefDistinctClassCode = "SELECT " + "DISTINCT anyo.ClassCode "
            + "FROM mssbam110.any_obj AS anyo " + "INNER JOIN mssbam110.scope scp ON " + "scp.Id = anyo.Id "
            + "INNER JOIN mssbam110.valuedef val ON " + "val.Id = anyo.Id "
            + "INNER JOIN mssbam110.atom_def atm ON " + "atm.Id = anyo.Id ";

    public final static String S_sqlSelectAtomDefBuff = "SELECT " + "anyo.ClassCode, " + "anyo.Id, "
            + "anyo.TenantId, " + "anyo.ScopeId, " + "anyo.Name, " + "anyo.short_name, " + "anyo.Label, "
            + "anyo.short_descr, " + "anyo.descr, " + "anyo.AuthorId, " + "val.ValueContainerId, "
            + "val.IsNullable, " + "val.GenerateId, " + "val.DataScopeId, " + "val.ViewAccessSecurityId, "
            + "val.EditAccessSecurityId, " + "val.ViewAccessFrequencyId, " + "val.EditAccessFrequencyId, "
            + "val.PrevId, " + "val.NextId, " + "atm.DbName, " + "anyo.Revision "
            + "FROM mssbam110.any_obj AS anyo " + "INNER JOIN mssbam110.scope scp ON " + "scp.Id = anyo.Id "
            + "INNER JOIN mssbam110.valuedef val ON " + "val.Id = anyo.Id "
            + "INNER JOIN mssbam110.atom_def atm ON " + "atm.Id = anyo.Id ";

    protected MSSBamAtomDefBuff unpackAtomDefResultSetToBuff(ResultSet resultSet) throws SQLException {
        final String S_ProcName = "unpackAtomDefResultSetToBuff";
        int idxcol = 1;
        String classCode = resultSet.getString(idxcol);
        idxcol++;
        MSSBamAtomDefBuff buff;
        if (classCode.equals("ATM")) {
            buff = schema.getFactoryAtomDef().newBuff();
        } else if (classCode.equals("BLB")) {
            buff = schema.getFactoryBlobDef().newBuff();
        } else if (classCode.equals("TBLB")) {
            buff = schema.getFactoryTableBlob().newBuff();
        } else if (classCode.equals("SBLB")) {
            buff = schema.getFactorySchemaBlob().newBuff();
        } else if (classCode.equals("BLN")) {
            buff = schema.getFactoryBoolDef().newBuff();
        } else if (classCode.equals("TBLN")) {
            buff = schema.getFactoryTableBool().newBuff();
        } else if (classCode.equals("SBLN")) {
            buff = schema.getFactorySchemaBool().newBuff();
        } else if (classCode.equals("DAT")) {
            buff = schema.getFactoryDateDef().newBuff();
        } else if (classCode.equals("TDAT")) {
            buff = schema.getFactoryTableDate().newBuff();
        } else if (classCode.equals("SDAT")) {
            buff = schema.getFactorySchemaDate().newBuff();
        } else if (classCode.equals("DBL")) {
            buff = schema.getFactoryDoubleDef().newBuff();
        } else if (classCode.equals("TDBL")) {
            buff = schema.getFactoryTableDouble().newBuff();
        } else if (classCode.equals("SDBL")) {
            buff = schema.getFactorySchemaDouble().newBuff();
        } else if (classCode.equals("NUM")) {
            buff = schema.getFactoryNumberDef().newBuff();
        } else if (classCode.equals("TNUM")) {
            buff = schema.getFactoryTableNumber().newBuff();
        } else if (classCode.equals("SNUM")) {
            buff = schema.getFactorySchemaNumber().newBuff();
        } else if (classCode.equals("FLT")) {
            buff = schema.getFactoryFloatDef().newBuff();
        } else if (classCode.equals("TFLT")) {
            buff = schema.getFactoryTableFloat().newBuff();
        } else if (classCode.equals("SFLT")) {
            buff = schema.getFactorySchemaFloat().newBuff();
        } else if (classCode.equals("I16")) {
            buff = schema.getFactoryInt16Def().newBuff();
        } else if (classCode.equals("TI16")) {
            buff = schema.getFactoryTableInt16().newBuff();
        } else if (classCode.equals("SI16")) {
            buff = schema.getFactorySchemaInt16().newBuff();
        } else if (classCode.equals("ENM")) {
            buff = schema.getFactoryEnumDef().newBuff();
        } else if (classCode.equals("TENM")) {
            buff = schema.getFactoryTableEnum().newBuff();
        } else if (classCode.equals("SENM")) {
            buff = schema.getFactorySchemaEnum().newBuff();
        } else if (classCode.equals("G16")) {
            buff = schema.getFactoryId16GenDef().newBuff();
        } else if (classCode.equals("TG16")) {
            buff = schema.getFactoryTableId16Gen().newBuff();
        } else if (classCode.equals("SG16")) {
            buff = schema.getFactorySchemaId16Gen().newBuff();
        } else if (classCode.equals("U16")) {
            buff = schema.getFactoryUInt16Def().newBuff();
        } else if (classCode.equals("TU16")) {
            buff = schema.getFactoryTableUInt16().newBuff();
        } else if (classCode.equals("SU16")) {
            buff = schema.getFactorySchemaUInt16().newBuff();
        } else if (classCode.equals("I32")) {
            buff = schema.getFactoryInt32Def().newBuff();
        } else if (classCode.equals("TI32")) {
            buff = schema.getFactoryTableInt32().newBuff();
        } else if (classCode.equals("SI32")) {
            buff = schema.getFactorySchemaInt32().newBuff();
        } else if (classCode.equals("G32")) {
            buff = schema.getFactoryId32GenDef().newBuff();
        } else if (classCode.equals("TG32")) {
            buff = schema.getFactoryTableId32Gen().newBuff();
        } else if (classCode.equals("SG32")) {
            buff = schema.getFactorySchemaId32Gen().newBuff();
        } else if (classCode.equals("U32")) {
            buff = schema.getFactoryUInt32Def().newBuff();
        } else if (classCode.equals("TU32")) {
            buff = schema.getFactoryTableUInt32().newBuff();
        } else if (classCode.equals("SU32")) {
            buff = schema.getFactorySchemaUInt32().newBuff();
        } else if (classCode.equals("I64")) {
            buff = schema.getFactoryInt64Def().newBuff();
        } else if (classCode.equals("TI64")) {
            buff = schema.getFactoryTableInt64().newBuff();
        } else if (classCode.equals("SI64")) {
            buff = schema.getFactorySchemaInt64().newBuff();
        } else if (classCode.equals("G64")) {
            buff = schema.getFactoryId64GenDef().newBuff();
        } else if (classCode.equals("TG64")) {
            buff = schema.getFactoryTableId64Gen().newBuff();
        } else if (classCode.equals("SG64")) {
            buff = schema.getFactorySchemaId64Gen().newBuff();
        } else if (classCode.equals("U64")) {
            buff = schema.getFactoryUInt64Def().newBuff();
        } else if (classCode.equals("TU64")) {
            buff = schema.getFactoryTableUInt64().newBuff();
        } else if (classCode.equals("SU64")) {
            buff = schema.getFactorySchemaUInt64().newBuff();
        } else if (classCode.equals("UUID")) {
            buff = schema.getFactoryUuidDef().newBuff();
        } else if (classCode.equals("TUUI")) {
            buff = schema.getFactoryTableUuid().newBuff();
        } else if (classCode.equals("SUUI")) {
            buff = schema.getFactorySchemaUuid().newBuff();
        } else if (classCode.equals("IDGU")) {
            buff = schema.getFactoryUuidGenDef().newBuff();
        } else if (classCode.equals("TGUU")) {
            buff = schema.getFactoryTableUuidGen().newBuff();
        } else if (classCode.equals("SGUU")) {
            buff = schema.getFactorySchemaUuidGen().newBuff();
        } else if (classCode.equals("NMT")) {
            buff = schema.getFactoryNmTokenDef().newBuff();
        } else if (classCode.equals("TNTK")) {
            buff = schema.getFactoryTableNmToken().newBuff();
        } else if (classCode.equals("SNTK")) {
            buff = schema.getFactorySchemaNmToken().newBuff();
        } else if (classCode.equals("NMS")) {
            buff = schema.getFactoryNmTokensDef().newBuff();
        } else if (classCode.equals("TNTS")) {
            buff = schema.getFactoryTableNmTokens().newBuff();
        } else if (classCode.equals("SNTS")) {
            buff = schema.getFactorySchemaNmTokens().newBuff();
        } else if (classCode.equals("STR")) {
            buff = schema.getFactoryStringDef().newBuff();
        } else if (classCode.equals("TSTR")) {
            buff = schema.getFactoryTableString().newBuff();
        } else if (classCode.equals("SSTR")) {
            buff = schema.getFactorySchemaString().newBuff();
        } else if (classCode.equals("ZDY")) {
            buff = schema.getFactoryTZDateDef().newBuff();
        } else if (classCode.equals("TZDY")) {
            buff = schema.getFactoryTableTZDate().newBuff();
        } else if (classCode.equals("SZDY")) {
            buff = schema.getFactorySchemaTZDate().newBuff();
        } else if (classCode.equals("ZTM")) {
            buff = schema.getFactoryTZTimeDef().newBuff();
        } else if (classCode.equals("TZTM")) {
            buff = schema.getFactoryTableTZTime().newBuff();
        } else if (classCode.equals("SZTM")) {
            buff = schema.getFactorySchemaTZTime().newBuff();
        } else if (classCode.equals("ZSP")) {
            buff = schema.getFactoryTZTimestampDef().newBuff();
        } else if (classCode.equals("TZST")) {
            buff = schema.getFactoryTableTZTimestamp().newBuff();
        } else if (classCode.equals("SZST")) {
            buff = schema.getFactorySchemaTZTimestamp().newBuff();
        } else if (classCode.equals("TXT")) {
            buff = schema.getFactoryTextDef().newBuff();
        } else if (classCode.equals("TTXT")) {
            buff = schema.getFactoryTableText().newBuff();
        } else if (classCode.equals("STXT")) {
            buff = schema.getFactorySchemaText().newBuff();
        } else if (classCode.equals("TIM")) {
            buff = schema.getFactoryTimeDef().newBuff();
        } else if (classCode.equals("TTIM")) {
            buff = schema.getFactoryTableTime().newBuff();
        } else if (classCode.equals("STIM")) {
            buff = schema.getFactorySchemaTime().newBuff();
        } else if (classCode.equals("TSP")) {
            buff = schema.getFactoryTimestampDef().newBuff();
        } else if (classCode.equals("TTSM")) {
            buff = schema.getFactoryTableTimestamp().newBuff();
        } else if (classCode.equals("STSM")) {
            buff = schema.getFactorySchemaTimestamp().newBuff();
        } else if (classCode.equals("TKN")) {
            buff = schema.getFactoryTokenDef().newBuff();
        } else if (classCode.equals("TTOK")) {
            buff = schema.getFactoryTableToken().newBuff();
        } else if (classCode.equals("STOK")) {
            buff = schema.getFactorySchemaToken().newBuff();
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Unrecognized class code \"" + classCode + "\"");
        }
        buff.setRequiredId(resultSet.getLong(idxcol));
        idxcol++;
        buff.setRequiredTenantId(resultSet.getLong(idxcol));
        idxcol++;
        {
            long colVal = resultSet.getLong(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalScopeId(null);
            } else {
                buff.setOptionalScopeId(colVal);
            }
        }
        idxcol++;
        buff.setRequiredName(resultSet.getString(idxcol));
        idxcol++;
        {
            String colVal = resultSet.getString(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalShortName(null);
            } else {
                buff.setOptionalShortName(colVal);
            }
        }
        idxcol++;
        {
            String colVal = resultSet.getString(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalLabel(null);
            } else {
                buff.setOptionalLabel(colVal);
            }
        }
        idxcol++;
        {
            String colVal = resultSet.getString(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalShortDescription(null);
            } else {
                buff.setOptionalShortDescription(colVal);
            }
        }
        idxcol++;
        {
            String colVal = resultSet.getString(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalDescription(null);
            } else {
                buff.setOptionalDescription(colVal);
            }
        }
        idxcol++;
        {
            long colVal = resultSet.getLong(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalAuthorId(null);
            } else {
                buff.setOptionalAuthorId(colVal);
            }
        }
        idxcol++;
        buff.setRequiredValueContainerId(resultSet.getLong(idxcol));
        idxcol++;
        buff.setRequiredIsNullable(resultSet.getBoolean(idxcol));
        idxcol++;
        {
            boolean colVal = resultSet.getBoolean(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalGenerateId(null);
            } else {
                buff.setOptionalGenerateId(colVal);
            }
        }
        idxcol++;
        {
            short colVal = resultSet.getShort(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalDataScopeId(null);
            } else {
                buff.setOptionalDataScopeId(colVal);
            }
        }
        idxcol++;
        {
            short colVal = resultSet.getShort(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalViewAccessSecurityId(null);
            } else {
                buff.setOptionalViewAccessSecurityId(colVal);
            }
        }
        idxcol++;
        {
            short colVal = resultSet.getShort(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalEditAccessSecurityId(null);
            } else {
                buff.setOptionalEditAccessSecurityId(colVal);
            }
        }
        idxcol++;
        {
            short colVal = resultSet.getShort(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalViewAccessFrequencyId(null);
            } else {
                buff.setOptionalViewAccessFrequencyId(colVal);
            }
        }
        idxcol++;
        {
            short colVal = resultSet.getShort(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalEditAccessFrequencyId(null);
            } else {
                buff.setOptionalEditAccessFrequencyId(colVal);
            }
        }
        idxcol++;
        {
            long colVal = resultSet.getLong(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalPrevId(null);
            } else {
                buff.setOptionalPrevId(colVal);
            }
        }
        idxcol++;
        {
            long colVal = resultSet.getLong(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalNextId(null);
            } else {
                buff.setOptionalNextId(colVal);
            }
        }
        idxcol++;
        {
            String colVal = resultSet.getString(idxcol);
            if (resultSet.wasNull()) {
                buff.setOptionalDbName(null);
            } else {
                buff.setOptionalDbName(colVal);
            }
        }
        idxcol++;
        buff.setRequiredRevision(resultSet.getInt(idxcol));
        return (buff);
    }

    public MSSBamAtomDefBuff readDerived(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) {
        final String S_ProcName = "readDerived()";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        MSSBamAtomDefBuff buff;
        long Id = PKey.getRequiredId();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE " + "atm.Id = " + Long.toString(Id) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            if (resultSet.next()) {
                classCode = resultSet.getString(1);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
                }
            } else {
                return (null);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        if (classCode.equals("ATM")) {
            buff = readBuff(Authorization, PKey);
        } else if (classCode.equals("BLB")) {
            buff = schema.getTableBlobDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TBLB")) {
            buff = schema.getTableTableBlob().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SBLB")) {
            buff = schema.getTableSchemaBlob().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("BLN")) {
            buff = schema.getTableBoolDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TBLN")) {
            buff = schema.getTableTableBool().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SBLN")) {
            buff = schema.getTableSchemaBool().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("DAT")) {
            buff = schema.getTableDateDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TDAT")) {
            buff = schema.getTableTableDate().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SDAT")) {
            buff = schema.getTableSchemaDate().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("DBL")) {
            buff = schema.getTableDoubleDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TDBL")) {
            buff = schema.getTableTableDouble().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SDBL")) {
            buff = schema.getTableSchemaDouble().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("NUM")) {
            buff = schema.getTableNumberDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TNUM")) {
            buff = schema.getTableTableNumber().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SNUM")) {
            buff = schema.getTableSchemaNumber().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("FLT")) {
            buff = schema.getTableFloatDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TFLT")) {
            buff = schema.getTableTableFloat().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SFLT")) {
            buff = schema.getTableSchemaFloat().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("I16")) {
            buff = schema.getTableInt16Def().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TI16")) {
            buff = schema.getTableTableInt16().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SI16")) {
            buff = schema.getTableSchemaInt16().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("ENM")) {
            buff = schema.getTableEnumDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TENM")) {
            buff = schema.getTableTableEnum().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SENM")) {
            buff = schema.getTableSchemaEnum().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("G16")) {
            buff = schema.getTableId16GenDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TG16")) {
            buff = schema.getTableTableId16Gen().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SG16")) {
            buff = schema.getTableSchemaId16Gen().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("U16")) {
            buff = schema.getTableUInt16Def().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TU16")) {
            buff = schema.getTableTableUInt16().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SU16")) {
            buff = schema.getTableSchemaUInt16().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("I32")) {
            buff = schema.getTableInt32Def().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TI32")) {
            buff = schema.getTableTableInt32().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SI32")) {
            buff = schema.getTableSchemaInt32().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("G32")) {
            buff = schema.getTableId32GenDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TG32")) {
            buff = schema.getTableTableId32Gen().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SG32")) {
            buff = schema.getTableSchemaId32Gen().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("U32")) {
            buff = schema.getTableUInt32Def().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TU32")) {
            buff = schema.getTableTableUInt32().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SU32")) {
            buff = schema.getTableSchemaUInt32().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("I64")) {
            buff = schema.getTableInt64Def().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TI64")) {
            buff = schema.getTableTableInt64().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SI64")) {
            buff = schema.getTableSchemaInt64().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("G64")) {
            buff = schema.getTableId64GenDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TG64")) {
            buff = schema.getTableTableId64Gen().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SG64")) {
            buff = schema.getTableSchemaId64Gen().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("U64")) {
            buff = schema.getTableUInt64Def().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TU64")) {
            buff = schema.getTableTableUInt64().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SU64")) {
            buff = schema.getTableSchemaUInt64().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("UUID")) {
            buff = schema.getTableUuidDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TUUI")) {
            buff = schema.getTableTableUuid().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SUUI")) {
            buff = schema.getTableSchemaUuid().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("IDGU")) {
            buff = schema.getTableUuidGenDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TGUU")) {
            buff = schema.getTableTableUuidGen().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SGUU")) {
            buff = schema.getTableSchemaUuidGen().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("NMT")) {
            buff = schema.getTableNmTokenDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TNTK")) {
            buff = schema.getTableTableNmToken().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SNTK")) {
            buff = schema.getTableSchemaNmToken().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("NMS")) {
            buff = schema.getTableNmTokensDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TNTS")) {
            buff = schema.getTableTableNmTokens().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SNTS")) {
            buff = schema.getTableSchemaNmTokens().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("STR")) {
            buff = schema.getTableStringDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TSTR")) {
            buff = schema.getTableTableString().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SSTR")) {
            buff = schema.getTableSchemaString().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("ZDY")) {
            buff = schema.getTableTZDateDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TZDY")) {
            buff = schema.getTableTableTZDate().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SZDY")) {
            buff = schema.getTableSchemaTZDate().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("ZTM")) {
            buff = schema.getTableTZTimeDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TZTM")) {
            buff = schema.getTableTableTZTime().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SZTM")) {
            buff = schema.getTableSchemaTZTime().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("ZSP")) {
            buff = schema.getTableTZTimestampDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TZST")) {
            buff = schema.getTableTableTZTimestamp().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("SZST")) {
            buff = schema.getTableSchemaTZTimestamp().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TXT")) {
            buff = schema.getTableTextDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TTXT")) {
            buff = schema.getTableTableText().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("STXT")) {
            buff = schema.getTableSchemaText().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TIM")) {
            buff = schema.getTableTimeDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TTIM")) {
            buff = schema.getTableTableTime().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("STIM")) {
            buff = schema.getTableSchemaTime().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TSP")) {
            buff = schema.getTableTimestampDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TTSM")) {
            buff = schema.getTableTableTimestamp().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("STSM")) {
            buff = schema.getTableSchemaTimestamp().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TKN")) {
            buff = schema.getTableTokenDef().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("TTOK")) {
            buff = schema.getTableTableToken().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else if (classCode.equals("STOK")) {
            buff = schema.getTableSchemaToken().readBuffByIdIdx(Authorization, PKey.getRequiredId());
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        return (buff);
    }

    public MSSBamAtomDefBuff[] readAllDerived(MSSBamAuthorization Authorization) {
        final String S_ProcName = "readAllDerived";
        MSSBamAtomDefBuff[] buffArray;
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        String classCode;
        ArrayList<String> classCodeList = new ArrayList<String>();
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode;
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        for (int classCodeIdx = 0; classCodeIdx < classCodeList.size(); classCodeIdx++) {
            MSSBamAtomDefBuff[] subList;
            classCode = classCodeList.get(classCodeIdx);
            if (classCode.equals("ATM")) {
                subList = readAllBuff(Authorization);
            } else if (classCode.equals("BLB")) {
                subList = schema.getTableBlobDef().readAllBuff(Authorization);
            } else if (classCode.equals("TBLB")) {
                subList = schema.getTableTableBlob().readAllBuff(Authorization);
            } else if (classCode.equals("SBLB")) {
                subList = schema.getTableSchemaBlob().readAllBuff(Authorization);
            } else if (classCode.equals("BLN")) {
                subList = schema.getTableBoolDef().readAllBuff(Authorization);
            } else if (classCode.equals("TBLN")) {
                subList = schema.getTableTableBool().readAllBuff(Authorization);
            } else if (classCode.equals("SBLN")) {
                subList = schema.getTableSchemaBool().readAllBuff(Authorization);
            } else if (classCode.equals("DAT")) {
                subList = schema.getTableDateDef().readAllBuff(Authorization);
            } else if (classCode.equals("TDAT")) {
                subList = schema.getTableTableDate().readAllBuff(Authorization);
            } else if (classCode.equals("SDAT")) {
                subList = schema.getTableSchemaDate().readAllBuff(Authorization);
            } else if (classCode.equals("DBL")) {
                subList = schema.getTableDoubleDef().readAllBuff(Authorization);
            } else if (classCode.equals("TDBL")) {
                subList = schema.getTableTableDouble().readAllBuff(Authorization);
            } else if (classCode.equals("SDBL")) {
                subList = schema.getTableSchemaDouble().readAllBuff(Authorization);
            } else if (classCode.equals("NUM")) {
                subList = schema.getTableNumberDef().readAllBuff(Authorization);
            } else if (classCode.equals("TNUM")) {
                subList = schema.getTableTableNumber().readAllBuff(Authorization);
            } else if (classCode.equals("SNUM")) {
                subList = schema.getTableSchemaNumber().readAllBuff(Authorization);
            } else if (classCode.equals("FLT")) {
                subList = schema.getTableFloatDef().readAllBuff(Authorization);
            } else if (classCode.equals("TFLT")) {
                subList = schema.getTableTableFloat().readAllBuff(Authorization);
            } else if (classCode.equals("SFLT")) {
                subList = schema.getTableSchemaFloat().readAllBuff(Authorization);
            } else if (classCode.equals("I16")) {
                subList = schema.getTableInt16Def().readAllBuff(Authorization);
            } else if (classCode.equals("TI16")) {
                subList = schema.getTableTableInt16().readAllBuff(Authorization);
            } else if (classCode.equals("SI16")) {
                subList = schema.getTableSchemaInt16().readAllBuff(Authorization);
            } else if (classCode.equals("ENM")) {
                subList = schema.getTableEnumDef().readAllBuff(Authorization);
            } else if (classCode.equals("TENM")) {
                subList = schema.getTableTableEnum().readAllBuff(Authorization);
            } else if (classCode.equals("SENM")) {
                subList = schema.getTableSchemaEnum().readAllBuff(Authorization);
            } else if (classCode.equals("G16")) {
                subList = schema.getTableId16GenDef().readAllBuff(Authorization);
            } else if (classCode.equals("TG16")) {
                subList = schema.getTableTableId16Gen().readAllBuff(Authorization);
            } else if (classCode.equals("SG16")) {
                subList = schema.getTableSchemaId16Gen().readAllBuff(Authorization);
            } else if (classCode.equals("U16")) {
                subList = schema.getTableUInt16Def().readAllBuff(Authorization);
            } else if (classCode.equals("TU16")) {
                subList = schema.getTableTableUInt16().readAllBuff(Authorization);
            } else if (classCode.equals("SU16")) {
                subList = schema.getTableSchemaUInt16().readAllBuff(Authorization);
            } else if (classCode.equals("I32")) {
                subList = schema.getTableInt32Def().readAllBuff(Authorization);
            } else if (classCode.equals("TI32")) {
                subList = schema.getTableTableInt32().readAllBuff(Authorization);
            } else if (classCode.equals("SI32")) {
                subList = schema.getTableSchemaInt32().readAllBuff(Authorization);
            } else if (classCode.equals("G32")) {
                subList = schema.getTableId32GenDef().readAllBuff(Authorization);
            } else if (classCode.equals("TG32")) {
                subList = schema.getTableTableId32Gen().readAllBuff(Authorization);
            } else if (classCode.equals("SG32")) {
                subList = schema.getTableSchemaId32Gen().readAllBuff(Authorization);
            } else if (classCode.equals("U32")) {
                subList = schema.getTableUInt32Def().readAllBuff(Authorization);
            } else if (classCode.equals("TU32")) {
                subList = schema.getTableTableUInt32().readAllBuff(Authorization);
            } else if (classCode.equals("SU32")) {
                subList = schema.getTableSchemaUInt32().readAllBuff(Authorization);
            } else if (classCode.equals("I64")) {
                subList = schema.getTableInt64Def().readAllBuff(Authorization);
            } else if (classCode.equals("TI64")) {
                subList = schema.getTableTableInt64().readAllBuff(Authorization);
            } else if (classCode.equals("SI64")) {
                subList = schema.getTableSchemaInt64().readAllBuff(Authorization);
            } else if (classCode.equals("G64")) {
                subList = schema.getTableId64GenDef().readAllBuff(Authorization);
            } else if (classCode.equals("TG64")) {
                subList = schema.getTableTableId64Gen().readAllBuff(Authorization);
            } else if (classCode.equals("SG64")) {
                subList = schema.getTableSchemaId64Gen().readAllBuff(Authorization);
            } else if (classCode.equals("U64")) {
                subList = schema.getTableUInt64Def().readAllBuff(Authorization);
            } else if (classCode.equals("TU64")) {
                subList = schema.getTableTableUInt64().readAllBuff(Authorization);
            } else if (classCode.equals("SU64")) {
                subList = schema.getTableSchemaUInt64().readAllBuff(Authorization);
            } else if (classCode.equals("UUID")) {
                subList = schema.getTableUuidDef().readAllBuff(Authorization);
            } else if (classCode.equals("TUUI")) {
                subList = schema.getTableTableUuid().readAllBuff(Authorization);
            } else if (classCode.equals("SUUI")) {
                subList = schema.getTableSchemaUuid().readAllBuff(Authorization);
            } else if (classCode.equals("IDGU")) {
                subList = schema.getTableUuidGenDef().readAllBuff(Authorization);
            } else if (classCode.equals("TGUU")) {
                subList = schema.getTableTableUuidGen().readAllBuff(Authorization);
            } else if (classCode.equals("SGUU")) {
                subList = schema.getTableSchemaUuidGen().readAllBuff(Authorization);
            } else if (classCode.equals("NMT")) {
                subList = schema.getTableNmTokenDef().readAllBuff(Authorization);
            } else if (classCode.equals("TNTK")) {
                subList = schema.getTableTableNmToken().readAllBuff(Authorization);
            } else if (classCode.equals("SNTK")) {
                subList = schema.getTableSchemaNmToken().readAllBuff(Authorization);
            } else if (classCode.equals("NMS")) {
                subList = schema.getTableNmTokensDef().readAllBuff(Authorization);
            } else if (classCode.equals("TNTS")) {
                subList = schema.getTableTableNmTokens().readAllBuff(Authorization);
            } else if (classCode.equals("SNTS")) {
                subList = schema.getTableSchemaNmTokens().readAllBuff(Authorization);
            } else if (classCode.equals("STR")) {
                subList = schema.getTableStringDef().readAllBuff(Authorization);
            } else if (classCode.equals("TSTR")) {
                subList = schema.getTableTableString().readAllBuff(Authorization);
            } else if (classCode.equals("SSTR")) {
                subList = schema.getTableSchemaString().readAllBuff(Authorization);
            } else if (classCode.equals("ZDY")) {
                subList = schema.getTableTZDateDef().readAllBuff(Authorization);
            } else if (classCode.equals("TZDY")) {
                subList = schema.getTableTableTZDate().readAllBuff(Authorization);
            } else if (classCode.equals("SZDY")) {
                subList = schema.getTableSchemaTZDate().readAllBuff(Authorization);
            } else if (classCode.equals("ZTM")) {
                subList = schema.getTableTZTimeDef().readAllBuff(Authorization);
            } else if (classCode.equals("TZTM")) {
                subList = schema.getTableTableTZTime().readAllBuff(Authorization);
            } else if (classCode.equals("SZTM")) {
                subList = schema.getTableSchemaTZTime().readAllBuff(Authorization);
            } else if (classCode.equals("ZSP")) {
                subList = schema.getTableTZTimestampDef().readAllBuff(Authorization);
            } else if (classCode.equals("TZST")) {
                subList = schema.getTableTableTZTimestamp().readAllBuff(Authorization);
            } else if (classCode.equals("SZST")) {
                subList = schema.getTableSchemaTZTimestamp().readAllBuff(Authorization);
            } else if (classCode.equals("TXT")) {
                subList = schema.getTableTextDef().readAllBuff(Authorization);
            } else if (classCode.equals("TTXT")) {
                subList = schema.getTableTableText().readAllBuff(Authorization);
            } else if (classCode.equals("STXT")) {
                subList = schema.getTableSchemaText().readAllBuff(Authorization);
            } else if (classCode.equals("TIM")) {
                subList = schema.getTableTimeDef().readAllBuff(Authorization);
            } else if (classCode.equals("TTIM")) {
                subList = schema.getTableTableTime().readAllBuff(Authorization);
            } else if (classCode.equals("STIM")) {
                subList = schema.getTableSchemaTime().readAllBuff(Authorization);
            } else if (classCode.equals("TSP")) {
                subList = schema.getTableTimestampDef().readAllBuff(Authorization);
            } else if (classCode.equals("TTSM")) {
                subList = schema.getTableTableTimestamp().readAllBuff(Authorization);
            } else if (classCode.equals("STSM")) {
                subList = schema.getTableSchemaTimestamp().readAllBuff(Authorization);
            } else if (classCode.equals("TKN")) {
                subList = schema.getTableTokenDef().readAllBuff(Authorization);
            } else if (classCode.equals("TTOK")) {
                subList = schema.getTableTableToken().readAllBuff(Authorization);
            } else if (classCode.equals("STOK")) {
                subList = schema.getTableSchemaToken().readAllBuff(Authorization);
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
            for (int idxSubList = 0; idxSubList < subList.length; idxSubList++) {
                resultList.add(subList[idxSubList]);
            }
        }
        buffArray = resultList.toArray(new MSSBamAtomDefBuff[0]);
        return (buffArray);
    }

    public MSSBamAtomDefBuff readDerivedByIdIdx(MSSBamAuthorization Authorization, long Id) {
        final String S_ProcName = "MSSBamPg8AtomDefTable.readDerivedByIdIdx() ";
        MSSBamAtomDefBuff buff;
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE " + "anyo.Id = " + Long.toString(Id) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            if (resultSet.next()) {
                classCode = resultSet.getString(1);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
                }
            } else {
                return (null);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        if (classCode.equals("ATM")) {
            buff = readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("BLB")) {
            buff = schema.getTableBlobDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TBLB")) {
            buff = schema.getTableTableBlob().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SBLB")) {
            buff = schema.getTableSchemaBlob().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("BLN")) {
            buff = schema.getTableBoolDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TBLN")) {
            buff = schema.getTableTableBool().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SBLN")) {
            buff = schema.getTableSchemaBool().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("DAT")) {
            buff = schema.getTableDateDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TDAT")) {
            buff = schema.getTableTableDate().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SDAT")) {
            buff = schema.getTableSchemaDate().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("DBL")) {
            buff = schema.getTableDoubleDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TDBL")) {
            buff = schema.getTableTableDouble().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SDBL")) {
            buff = schema.getTableSchemaDouble().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("NUM")) {
            buff = schema.getTableNumberDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TNUM")) {
            buff = schema.getTableTableNumber().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SNUM")) {
            buff = schema.getTableSchemaNumber().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("FLT")) {
            buff = schema.getTableFloatDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TFLT")) {
            buff = schema.getTableTableFloat().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SFLT")) {
            buff = schema.getTableSchemaFloat().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("I16")) {
            buff = schema.getTableInt16Def().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TI16")) {
            buff = schema.getTableTableInt16().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SI16")) {
            buff = schema.getTableSchemaInt16().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("ENM")) {
            buff = schema.getTableEnumDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TENM")) {
            buff = schema.getTableTableEnum().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SENM")) {
            buff = schema.getTableSchemaEnum().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("G16")) {
            buff = schema.getTableId16GenDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TG16")) {
            buff = schema.getTableTableId16Gen().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SG16")) {
            buff = schema.getTableSchemaId16Gen().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("U16")) {
            buff = schema.getTableUInt16Def().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TU16")) {
            buff = schema.getTableTableUInt16().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SU16")) {
            buff = schema.getTableSchemaUInt16().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("I32")) {
            buff = schema.getTableInt32Def().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TI32")) {
            buff = schema.getTableTableInt32().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SI32")) {
            buff = schema.getTableSchemaInt32().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("G32")) {
            buff = schema.getTableId32GenDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TG32")) {
            buff = schema.getTableTableId32Gen().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SG32")) {
            buff = schema.getTableSchemaId32Gen().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("U32")) {
            buff = schema.getTableUInt32Def().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TU32")) {
            buff = schema.getTableTableUInt32().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SU32")) {
            buff = schema.getTableSchemaUInt32().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("I64")) {
            buff = schema.getTableInt64Def().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TI64")) {
            buff = schema.getTableTableInt64().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SI64")) {
            buff = schema.getTableSchemaInt64().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("G64")) {
            buff = schema.getTableId64GenDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TG64")) {
            buff = schema.getTableTableId64Gen().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SG64")) {
            buff = schema.getTableSchemaId64Gen().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("U64")) {
            buff = schema.getTableUInt64Def().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TU64")) {
            buff = schema.getTableTableUInt64().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SU64")) {
            buff = schema.getTableSchemaUInt64().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("UUID")) {
            buff = schema.getTableUuidDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TUUI")) {
            buff = schema.getTableTableUuid().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SUUI")) {
            buff = schema.getTableSchemaUuid().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("IDGU")) {
            buff = schema.getTableUuidGenDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TGUU")) {
            buff = schema.getTableTableUuidGen().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SGUU")) {
            buff = schema.getTableSchemaUuidGen().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("NMT")) {
            buff = schema.getTableNmTokenDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TNTK")) {
            buff = schema.getTableTableNmToken().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SNTK")) {
            buff = schema.getTableSchemaNmToken().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("NMS")) {
            buff = schema.getTableNmTokensDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TNTS")) {
            buff = schema.getTableTableNmTokens().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SNTS")) {
            buff = schema.getTableSchemaNmTokens().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("STR")) {
            buff = schema.getTableStringDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TSTR")) {
            buff = schema.getTableTableString().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SSTR")) {
            buff = schema.getTableSchemaString().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("ZDY")) {
            buff = schema.getTableTZDateDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TZDY")) {
            buff = schema.getTableTableTZDate().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SZDY")) {
            buff = schema.getTableSchemaTZDate().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("ZTM")) {
            buff = schema.getTableTZTimeDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TZTM")) {
            buff = schema.getTableTableTZTime().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SZTM")) {
            buff = schema.getTableSchemaTZTime().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("ZSP")) {
            buff = schema.getTableTZTimestampDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TZST")) {
            buff = schema.getTableTableTZTimestamp().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("SZST")) {
            buff = schema.getTableSchemaTZTimestamp().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TXT")) {
            buff = schema.getTableTextDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TTXT")) {
            buff = schema.getTableTableText().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("STXT")) {
            buff = schema.getTableSchemaText().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TIM")) {
            buff = schema.getTableTimeDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TTIM")) {
            buff = schema.getTableTableTime().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("STIM")) {
            buff = schema.getTableSchemaTime().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TSP")) {
            buff = schema.getTableTimestampDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TTSM")) {
            buff = schema.getTableTableTimestamp().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("STSM")) {
            buff = schema.getTableSchemaTimestamp().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TKN")) {
            buff = schema.getTableTokenDef().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("TTOK")) {
            buff = schema.getTableTableToken().readBuffByIdIdx(Authorization, Id);
        } else if (classCode.equals("STOK")) {
            buff = schema.getTableSchemaToken().readBuffByIdIdx(Authorization, Id);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        return (buff);
    }

    public MSSBamAtomDefBuff[] readDerivedByTenantIdx(MSSBamAuthorization Authorization, long TenantId) {
        final String S_ProcName = "readDerivedByTenantIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE " + "anyo.TenantId = "
                    + Long.toString(TenantId) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByTenantIdx(Authorization, TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByTenantIdx(Authorization,
                        TenantId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) {
        final String S_ProcName = "readDerivedByScopeIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((ScopeId == null) ? "anyo.ScopeId is null " : "anyo.ScopeId = " + ScopeId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByScopeIdx(Authorization, ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByScopeIdx(Authorization,
                        ScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) {
        final String S_ProcName = "readDerivedByAuthorIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((AuthorId == null) ? "anyo.AuthorId is null "
                            : "anyo.AuthorId = " + AuthorId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByAuthorIdx(Authorization, AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByAuthorIdx(Authorization,
                        AuthorId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff readDerivedByUNameIdx(MSSBamAuthorization Authorization, Long ScopeId, String Name) {
        final String S_ProcName = "MSSBamPg8AtomDefTable.readDerivedByUNameIdx() ";
        MSSBamAtomDefBuff buff;
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((ScopeId == null) ? "anyo.ScopeId is null " : "anyo.ScopeId = " + ScopeId.toString() + " ")
                    + "AND " + "anyo.Name = " + MSSBamPg8Schema.getQuotedString(Name) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            if (resultSet.next()) {
                classCode = resultSet.getString(1);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
                }
            } else {
                return (null);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        if (classCode.equals("ATM")) {
            buff = readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("BLB")) {
            buff = schema.getTableBlobDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TBLB")) {
            buff = schema.getTableTableBlob().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SBLB")) {
            buff = schema.getTableSchemaBlob().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("BLN")) {
            buff = schema.getTableBoolDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TBLN")) {
            buff = schema.getTableTableBool().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SBLN")) {
            buff = schema.getTableSchemaBool().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("DAT")) {
            buff = schema.getTableDateDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TDAT")) {
            buff = schema.getTableTableDate().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SDAT")) {
            buff = schema.getTableSchemaDate().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("DBL")) {
            buff = schema.getTableDoubleDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TDBL")) {
            buff = schema.getTableTableDouble().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SDBL")) {
            buff = schema.getTableSchemaDouble().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("NUM")) {
            buff = schema.getTableNumberDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TNUM")) {
            buff = schema.getTableTableNumber().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SNUM")) {
            buff = schema.getTableSchemaNumber().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("FLT")) {
            buff = schema.getTableFloatDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TFLT")) {
            buff = schema.getTableTableFloat().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SFLT")) {
            buff = schema.getTableSchemaFloat().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("I16")) {
            buff = schema.getTableInt16Def().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TI16")) {
            buff = schema.getTableTableInt16().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SI16")) {
            buff = schema.getTableSchemaInt16().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("ENM")) {
            buff = schema.getTableEnumDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TENM")) {
            buff = schema.getTableTableEnum().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SENM")) {
            buff = schema.getTableSchemaEnum().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("G16")) {
            buff = schema.getTableId16GenDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TG16")) {
            buff = schema.getTableTableId16Gen().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SG16")) {
            buff = schema.getTableSchemaId16Gen().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("U16")) {
            buff = schema.getTableUInt16Def().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TU16")) {
            buff = schema.getTableTableUInt16().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SU16")) {
            buff = schema.getTableSchemaUInt16().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("I32")) {
            buff = schema.getTableInt32Def().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TI32")) {
            buff = schema.getTableTableInt32().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SI32")) {
            buff = schema.getTableSchemaInt32().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("G32")) {
            buff = schema.getTableId32GenDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TG32")) {
            buff = schema.getTableTableId32Gen().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SG32")) {
            buff = schema.getTableSchemaId32Gen().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("U32")) {
            buff = schema.getTableUInt32Def().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TU32")) {
            buff = schema.getTableTableUInt32().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SU32")) {
            buff = schema.getTableSchemaUInt32().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("I64")) {
            buff = schema.getTableInt64Def().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TI64")) {
            buff = schema.getTableTableInt64().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SI64")) {
            buff = schema.getTableSchemaInt64().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("G64")) {
            buff = schema.getTableId64GenDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TG64")) {
            buff = schema.getTableTableId64Gen().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SG64")) {
            buff = schema.getTableSchemaId64Gen().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("U64")) {
            buff = schema.getTableUInt64Def().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TU64")) {
            buff = schema.getTableTableUInt64().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SU64")) {
            buff = schema.getTableSchemaUInt64().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("UUID")) {
            buff = schema.getTableUuidDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TUUI")) {
            buff = schema.getTableTableUuid().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SUUI")) {
            buff = schema.getTableSchemaUuid().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("IDGU")) {
            buff = schema.getTableUuidGenDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TGUU")) {
            buff = schema.getTableTableUuidGen().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SGUU")) {
            buff = schema.getTableSchemaUuidGen().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("NMT")) {
            buff = schema.getTableNmTokenDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TNTK")) {
            buff = schema.getTableTableNmToken().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SNTK")) {
            buff = schema.getTableSchemaNmToken().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("NMS")) {
            buff = schema.getTableNmTokensDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TNTS")) {
            buff = schema.getTableTableNmTokens().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SNTS")) {
            buff = schema.getTableSchemaNmTokens().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("STR")) {
            buff = schema.getTableStringDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TSTR")) {
            buff = schema.getTableTableString().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SSTR")) {
            buff = schema.getTableSchemaString().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("ZDY")) {
            buff = schema.getTableTZDateDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TZDY")) {
            buff = schema.getTableTableTZDate().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SZDY")) {
            buff = schema.getTableSchemaTZDate().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("ZTM")) {
            buff = schema.getTableTZTimeDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TZTM")) {
            buff = schema.getTableTableTZTime().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SZTM")) {
            buff = schema.getTableSchemaTZTime().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("ZSP")) {
            buff = schema.getTableTZTimestampDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TZST")) {
            buff = schema.getTableTableTZTimestamp().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("SZST")) {
            buff = schema.getTableSchemaTZTimestamp().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TXT")) {
            buff = schema.getTableTextDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TTXT")) {
            buff = schema.getTableTableText().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("STXT")) {
            buff = schema.getTableSchemaText().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TIM")) {
            buff = schema.getTableTimeDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TTIM")) {
            buff = schema.getTableTableTime().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("STIM")) {
            buff = schema.getTableSchemaTime().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TSP")) {
            buff = schema.getTableTimestampDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TTSM")) {
            buff = schema.getTableTableTimestamp().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("STSM")) {
            buff = schema.getTableSchemaTimestamp().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TKN")) {
            buff = schema.getTableTokenDef().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("TTOK")) {
            buff = schema.getTableTableToken().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else if (classCode.equals("STOK")) {
            buff = schema.getTableSchemaToken().readBuffByUNameIdx(Authorization, ScopeId, Name);
        } else {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
        return (buff);
    }

    public MSSBamAtomDefBuff[] readDerivedByVContIdx(MSSBamAuthorization Authorization, long ValueContainerId) {
        final String S_ProcName = "readDerivedByVContIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE " + "val.ValueContainerId = "
                    + Long.toString(ValueContainerId) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByVContIdx(Authorization, ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByVContIdx(Authorization, ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByVContIdx(Authorization, ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByVContIdx(Authorization, ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByVContIdx(Authorization, ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByVContIdx(Authorization, ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByVContIdx(Authorization, ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByVContIdx(Authorization,
                        ValueContainerId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByDataScopeIdx(MSSBamAuthorization Authorization, Short DataScopeId) {
        final String S_ProcName = "readDerivedByDataScopeIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((DataScopeId == null) ? "val.DataScopeId is null "
                            : "val.DataScopeId = " + DataScopeId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByDataScopeIdx(Authorization, DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByDataScopeIdx(Authorization,
                        DataScopeId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByVAccSecIdx(MSSBamAuthorization Authorization,
            Short ViewAccessSecurityId) {
        final String S_ProcName = "readDerivedByVAccSecIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((ViewAccessSecurityId == null) ? "val.ViewAccessSecurityId is null "
                            : "val.ViewAccessSecurityId = " + ViewAccessSecurityId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByVAccSecIdx(Authorization, ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByVAccSecIdx(Authorization,
                        ViewAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByVAccFreqIdx(MSSBamAuthorization Authorization,
            Short ViewAccessFrequencyId) {
        final String S_ProcName = "readDerivedByVAccFreqIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((ViewAccessFrequencyId == null) ? "val.ViewAccessFrequencyId is null "
                            : "val.ViewAccessFrequencyId = " + ViewAccessFrequencyId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByVAccFreqIdx(Authorization, ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByVAccFreqIdx(Authorization,
                        ViewAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByEAccSecIdx(MSSBamAuthorization Authorization,
            Short EditAccessSecurityId) {
        final String S_ProcName = "readDerivedByEAccSecIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((EditAccessSecurityId == null) ? "val.EditAccessSecurityId is null "
                            : "val.EditAccessSecurityId = " + EditAccessSecurityId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByEAccSecIdx(Authorization, EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByEAccSecIdx(Authorization,
                        EditAccessSecurityId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByEAccFreqIdx(MSSBamAuthorization Authorization,
            Short EditAccessFrequencyId) {
        final String S_ProcName = "readDerivedByEAccFreqIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((EditAccessFrequencyId == null) ? "val.EditAccessFrequencyId is null "
                            : "val.EditAccessFrequencyId = " + EditAccessFrequencyId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByEAccFreqIdx(Authorization, EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByEAccFreqIdx(Authorization,
                        EditAccessFrequencyId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByPrevIdx(MSSBamAuthorization Authorization, Long PrevId) {
        final String S_ProcName = "readDerivedByPrevIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((PrevId == null) ? "val.PrevId is null " : "val.PrevId = " + PrevId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByPrevIdx(Authorization, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByPrevIdx(Authorization,
                        PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByNextIdx(MSSBamAuthorization Authorization, Long NextId) {
        final String S_ProcName = "readDerivedByNextIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE "
                    + ((NextId == null) ? "val.NextId is null " : "val.NextId = " + NextId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByNextIdx(Authorization, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByNextIdx(Authorization,
                        NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByContPrevIdx(MSSBamAuthorization Authorization, long ValueContainerId,
            Long PrevId) {
        final String S_ProcName = "readDerivedByContPrevIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE " + "val.ValueContainerId = "
                    + Long.toString(ValueContainerId) + " " + "AND "
                    + ((PrevId == null) ? "val.PrevId is null " : "val.PrevId = " + PrevId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByContPrevIdx(Authorization, ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByContPrevIdx(Authorization,
                        ValueContainerId, PrevId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff[] readDerivedByContNextIdx(MSSBamAuthorization Authorization, long ValueContainerId,
            Long NextId) {
        final String S_ProcName = "readDerivedByContNextIdx";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        ArrayList<String> classCodeList = new ArrayList<String>();
        String classCode;
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefDistinctClassCode + "WHERE " + "val.ValueContainerId = "
                    + Long.toString(ValueContainerId) + " " + "AND "
                    + ((NextId == null) ? "val.NextId is null " : "val.NextId = " + NextId.toString() + " ");
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        ArrayList<MSSBamAtomDefBuff> resultList = new ArrayList<MSSBamAtomDefBuff>();
        ListIterator<String> classCodeIter = classCodeList.listIterator();
        while (classCodeIter.hasNext()) {
            classCode = classCodeIter.next();
            if (classCode.equals("ATM")) {
                MSSBamAtomDefBuff[] subList = readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLB")) {
                MSSBamBlobDefBuff[] subList = schema.getTableBlobDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLB")) {
                MSSBamTableBlobBuff[] subList = schema.getTableTableBlob().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLB")) {
                MSSBamSchemaBlobBuff[] subList = schema.getTableSchemaBlob().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("BLN")) {
                MSSBamBoolDefBuff[] subList = schema.getTableBoolDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TBLN")) {
                MSSBamTableBoolBuff[] subList = schema.getTableTableBool().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SBLN")) {
                MSSBamSchemaBoolBuff[] subList = schema.getTableSchemaBool().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DAT")) {
                MSSBamDateDefBuff[] subList = schema.getTableDateDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDAT")) {
                MSSBamTableDateBuff[] subList = schema.getTableTableDate().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDAT")) {
                MSSBamSchemaDateBuff[] subList = schema.getTableSchemaDate().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("DBL")) {
                MSSBamDoubleDefBuff[] subList = schema.getTableDoubleDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TDBL")) {
                MSSBamTableDoubleBuff[] subList = schema.getTableTableDouble().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SDBL")) {
                MSSBamSchemaDoubleBuff[] subList = schema.getTableSchemaDouble()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NUM")) {
                MSSBamNumberDefBuff[] subList = schema.getTableNumberDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNUM")) {
                MSSBamTableNumberBuff[] subList = schema.getTableTableNumber().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNUM")) {
                MSSBamSchemaNumberBuff[] subList = schema.getTableSchemaNumber()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("FLT")) {
                MSSBamFloatDefBuff[] subList = schema.getTableFloatDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TFLT")) {
                MSSBamTableFloatBuff[] subList = schema.getTableTableFloat().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SFLT")) {
                MSSBamSchemaFloatBuff[] subList = schema.getTableSchemaFloat().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I16")) {
                MSSBamInt16DefBuff[] subList = schema.getTableInt16Def().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI16")) {
                MSSBamTableInt16Buff[] subList = schema.getTableTableInt16().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI16")) {
                MSSBamSchemaInt16Buff[] subList = schema.getTableSchemaInt16().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ENM")) {
                MSSBamEnumDefBuff[] subList = schema.getTableEnumDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TENM")) {
                MSSBamTableEnumBuff[] subList = schema.getTableTableEnum().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SENM")) {
                MSSBamSchemaEnumBuff[] subList = schema.getTableSchemaEnum().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G16")) {
                MSSBamId16GenDefBuff[] subList = schema.getTableId16GenDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG16")) {
                MSSBamTableId16GenBuff[] subList = schema.getTableTableId16Gen()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG16")) {
                MSSBamSchemaId16GenBuff[] subList = schema.getTableSchemaId16Gen()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U16")) {
                MSSBamUInt16DefBuff[] subList = schema.getTableUInt16Def().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU16")) {
                MSSBamTableUInt16Buff[] subList = schema.getTableTableUInt16().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU16")) {
                MSSBamSchemaUInt16Buff[] subList = schema.getTableSchemaUInt16()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I32")) {
                MSSBamInt32DefBuff[] subList = schema.getTableInt32Def().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI32")) {
                MSSBamTableInt32Buff[] subList = schema.getTableTableInt32().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI32")) {
                MSSBamSchemaInt32Buff[] subList = schema.getTableSchemaInt32().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G32")) {
                MSSBamId32GenDefBuff[] subList = schema.getTableId32GenDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG32")) {
                MSSBamTableId32GenBuff[] subList = schema.getTableTableId32Gen()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG32")) {
                MSSBamSchemaId32GenBuff[] subList = schema.getTableSchemaId32Gen()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U32")) {
                MSSBamUInt32DefBuff[] subList = schema.getTableUInt32Def().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU32")) {
                MSSBamTableUInt32Buff[] subList = schema.getTableTableUInt32().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU32")) {
                MSSBamSchemaUInt32Buff[] subList = schema.getTableSchemaUInt32()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("I64")) {
                MSSBamInt64DefBuff[] subList = schema.getTableInt64Def().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TI64")) {
                MSSBamTableInt64Buff[] subList = schema.getTableTableInt64().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SI64")) {
                MSSBamSchemaInt64Buff[] subList = schema.getTableSchemaInt64().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("G64")) {
                MSSBamId64GenDefBuff[] subList = schema.getTableId64GenDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TG64")) {
                MSSBamTableId64GenBuff[] subList = schema.getTableTableId64Gen()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SG64")) {
                MSSBamSchemaId64GenBuff[] subList = schema.getTableSchemaId64Gen()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("U64")) {
                MSSBamUInt64DefBuff[] subList = schema.getTableUInt64Def().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TU64")) {
                MSSBamTableUInt64Buff[] subList = schema.getTableTableUInt64().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SU64")) {
                MSSBamSchemaUInt64Buff[] subList = schema.getTableSchemaUInt64()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("UUID")) {
                MSSBamUuidDefBuff[] subList = schema.getTableUuidDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TUUI")) {
                MSSBamTableUuidBuff[] subList = schema.getTableTableUuid().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SUUI")) {
                MSSBamSchemaUuidBuff[] subList = schema.getTableSchemaUuid().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("IDGU")) {
                MSSBamUuidGenDefBuff[] subList = schema.getTableUuidGenDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TGUU")) {
                MSSBamTableUuidGenBuff[] subList = schema.getTableTableUuidGen()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SGUU")) {
                MSSBamSchemaUuidGenBuff[] subList = schema.getTableSchemaUuidGen()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMT")) {
                MSSBamNmTokenDefBuff[] subList = schema.getTableNmTokenDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTK")) {
                MSSBamTableNmTokenBuff[] subList = schema.getTableTableNmToken()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTK")) {
                MSSBamSchemaNmTokenBuff[] subList = schema.getTableSchemaNmToken()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("NMS")) {
                MSSBamNmTokensDefBuff[] subList = schema.getTableNmTokensDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TNTS")) {
                MSSBamTableNmTokensBuff[] subList = schema.getTableTableNmTokens()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SNTS")) {
                MSSBamSchemaNmTokensBuff[] subList = schema.getTableSchemaNmTokens()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STR")) {
                MSSBamStringDefBuff[] subList = schema.getTableStringDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSTR")) {
                MSSBamTableStringBuff[] subList = schema.getTableTableString().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SSTR")) {
                MSSBamSchemaStringBuff[] subList = schema.getTableSchemaString()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZDY")) {
                MSSBamTZDateDefBuff[] subList = schema.getTableTZDateDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZDY")) {
                MSSBamTableTZDateBuff[] subList = schema.getTableTableTZDate().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZDY")) {
                MSSBamSchemaTZDateBuff[] subList = schema.getTableSchemaTZDate()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZTM")) {
                MSSBamTZTimeDefBuff[] subList = schema.getTableTZTimeDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZTM")) {
                MSSBamTableTZTimeBuff[] subList = schema.getTableTableTZTime().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZTM")) {
                MSSBamSchemaTZTimeBuff[] subList = schema.getTableSchemaTZTime()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("ZSP")) {
                MSSBamTZTimestampDefBuff[] subList = schema.getTableTZTimestampDef()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TZST")) {
                MSSBamTableTZTimestampBuff[] subList = schema.getTableTableTZTimestamp()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("SZST")) {
                MSSBamSchemaTZTimestampBuff[] subList = schema.getTableSchemaTZTimestamp()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TXT")) {
                MSSBamTextDefBuff[] subList = schema.getTableTextDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTXT")) {
                MSSBamTableTextBuff[] subList = schema.getTableTableText().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STXT")) {
                MSSBamSchemaTextBuff[] subList = schema.getTableSchemaText().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TIM")) {
                MSSBamTimeDefBuff[] subList = schema.getTableTimeDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTIM")) {
                MSSBamTableTimeBuff[] subList = schema.getTableTableTime().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STIM")) {
                MSSBamSchemaTimeBuff[] subList = schema.getTableSchemaTime().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TSP")) {
                MSSBamTimestampDefBuff[] subList = schema.getTableTimestampDef()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTSM")) {
                MSSBamTableTimestampBuff[] subList = schema.getTableTableTimestamp()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STSM")) {
                MSSBamSchemaTimestampBuff[] subList = schema.getTableSchemaTimestamp()
                        .readBuffByContNextIdx(Authorization, ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TKN")) {
                MSSBamTokenDefBuff[] subList = schema.getTableTokenDef().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("TTOK")) {
                MSSBamTableTokenBuff[] subList = schema.getTableTableToken().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else if (classCode.equals("STOK")) {
                MSSBamSchemaTokenBuff[] subList = schema.getTableSchemaToken().readBuffByContNextIdx(Authorization,
                        ValueContainerId, NextId);
                for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                    resultList.add(subList[subListIdx]);
                }
            } else {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Did not expect ClassCode \"" + classCode + "\"");
            }
        }
        return (resultList.toArray(new MSSBamAtomDefBuff[0]));

    }

    public MSSBamAtomDefBuff readBuff(MSSBamAuthorization Authorization, MSSBamAnyObjPKey PKey) {
        final String S_ProcName = "readBuff";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        try {
            Connection cnx = schema.getCnx();
            long Id = PKey.getRequiredId();
            String sql = S_sqlSelectAtomDefBuff + "WHERE " + "anyo.Id = " + Long.toString(Id) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            if (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
                }
                return (buff);
            } else {
                return (null);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readAllBuff(MSSBamAuthorization Authorization) {
        final String S_ProcName = "readAllBuff";
        if (!schema.isTransactionOpen()) {
            throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                    "Transaction not open");
        }
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE " + "anyo.ClassCode = 'ATM' " + "ORDER BY "
                    + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff readBuffByIdIdx(MSSBamAuthorization Authorization, long Id) {
        final String S_ProcName = "readBuffByIdIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE " + "anyo.Id = " + Long.toString(Id) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            if (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
                }
                return (buff);
            } else {
                return (null);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByTenantIdx(MSSBamAuthorization Authorization, long TenantId) {
        final String S_ProcName = "readBuffByTenantIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE " + "anyo.TenantId = " + Long.toString(TenantId) + " "
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) {
        final String S_ProcName = "readBuffByScopeIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE "
                    + ((ScopeId == null) ? "anyo.ScopeId is null " : "anyo.ScopeId = " + ScopeId.toString() + " ")
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) {
        final String S_ProcName = "readBuffByAuthorIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE " + ((AuthorId == null) ? "anyo.AuthorId is null "
                    : "anyo.AuthorId = " + AuthorId.toString() + " ") + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff readBuffByUNameIdx(MSSBamAuthorization Authorization, Long ScopeId, String Name) {
        final String S_ProcName = "readBuffByUNameIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE "
                    + ((ScopeId == null) ? "anyo.ScopeId is null " : "anyo.ScopeId = " + ScopeId.toString() + " ")
                    + "AND " + "anyo.Name = " + MSSBamPg8Schema.getQuotedString(Name) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            if (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                if (resultSet.next()) {
                    resultSet.last();
                    throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                            "Did not expect multi-buff response, " + resultSet.getRow() + " rows selected");
                }
                return (buff);
            } else {
                return (null);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByVContIdx(MSSBamAuthorization Authorization, long ValueContainerId) {
        final String S_ProcName = "readBuffByVContIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE " + "val.ValueContainerId = "
                    + Long.toString(ValueContainerId) + " " + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByDataScopeIdx(MSSBamAuthorization Authorization, Short DataScopeId) {
        final String S_ProcName = "readBuffByDataScopeIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE " + ((DataScopeId == null) ? "val.DataScopeId is null "
                    : "val.DataScopeId = " + DataScopeId.toString() + " ") + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByVAccSecIdx(MSSBamAuthorization Authorization, Short ViewAccessSecurityId) {
        final String S_ProcName = "readBuffByVAccSecIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE "
                    + ((ViewAccessSecurityId == null) ? "val.ViewAccessSecurityId is null "
                            : "val.ViewAccessSecurityId = " + ViewAccessSecurityId.toString() + " ")
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByVAccFreqIdx(MSSBamAuthorization Authorization,
            Short ViewAccessFrequencyId) {
        final String S_ProcName = "readBuffByVAccFreqIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE "
                    + ((ViewAccessFrequencyId == null) ? "val.ViewAccessFrequencyId is null "
                            : "val.ViewAccessFrequencyId = " + ViewAccessFrequencyId.toString() + " ")
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByEAccSecIdx(MSSBamAuthorization Authorization, Short EditAccessSecurityId) {
        final String S_ProcName = "readBuffByEAccSecIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE "
                    + ((EditAccessSecurityId == null) ? "val.EditAccessSecurityId is null "
                            : "val.EditAccessSecurityId = " + EditAccessSecurityId.toString() + " ")
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByEAccFreqIdx(MSSBamAuthorization Authorization,
            Short EditAccessFrequencyId) {
        final String S_ProcName = "readBuffByEAccFreqIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE "
                    + ((EditAccessFrequencyId == null) ? "val.EditAccessFrequencyId is null "
                            : "val.EditAccessFrequencyId = " + EditAccessFrequencyId.toString() + " ")
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByPrevIdx(MSSBamAuthorization Authorization, Long PrevId) {
        final String S_ProcName = "readBuffByPrevIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE "
                    + ((PrevId == null) ? "val.PrevId is null " : "val.PrevId = " + PrevId.toString() + " ")
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByNextIdx(MSSBamAuthorization Authorization, Long NextId) {
        final String S_ProcName = "readBuffByNextIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE "
                    + ((NextId == null) ? "val.NextId is null " : "val.NextId = " + NextId.toString() + " ")
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByContPrevIdx(MSSBamAuthorization Authorization, long ValueContainerId,
            Long PrevId) {
        final String S_ProcName = "readBuffByContPrevIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE " + "val.ValueContainerId = "
                    + Long.toString(ValueContainerId) + " " + "AND "
                    + ((PrevId == null) ? "val.PrevId is null " : "val.PrevId = " + PrevId.toString() + " ")
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff[] readBuffByContNextIdx(MSSBamAuthorization Authorization, long ValueContainerId,
            Long NextId) {
        final String S_ProcName = "readBuffByContNextIdx";
        try {
            Connection cnx = schema.getCnx();
            String sql = S_sqlSelectAtomDefBuff + "WHERE " + "val.ValueContainerId = "
                    + Long.toString(ValueContainerId) + " " + "AND "
                    + ((NextId == null) ? "val.NextId is null " : "val.NextId = " + NextId.toString() + " ")
                    + "ORDER BY " + "anyo.Id ASC";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            ResultSet resultSet = stmt.executeQuery(sql);
            List<MSSBamAtomDefBuff> buffList = new ArrayList<MSSBamAtomDefBuff>();
            while (resultSet.next()) {
                MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
                buffList.add(buff);
            }
            return (buffList.toArray(new MSSBamAtomDefBuff[0]));
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public void updateAtomDef(MSSBamAuthorization Authorization, MSSBamAtomDefBuff Buff) {
        final String S_ProcName = "updateAtomDef";
        try {
            Connection cnx = schema.getCnx();
            long Id = Buff.getRequiredId();
            String DbName = Buff.getOptionalDbName();

            String sql = "UPDATE mssbam110.atom_def " + "SET " + "Id = " + MSSBamPg8Schema.getInt64String(Id) + ", "
                    + "DbName = " + ((DbName != null) ? MSSBamPg8Schema.getQuotedString(DbName) : "null") + " "
                    + "WHERE " + "Id = " + Long.toString(Id) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            int rowsAffected = stmt.executeUpdate(sql);
            if (rowsAffected != 1) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Expected 1 row to be affected by update, not " + rowsAffected);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public void deleteAtomDef(MSSBamAuthorization Authorization, MSSBamAtomDefBuff Buff) {
        final String S_ProcName = "deleteAtomDef";
        try {
            Connection cnx = schema.getCnx();
            long Id = Buff.getRequiredId();
            String DbName = Buff.getOptionalDbName();

            String sql = "DELETE FROM mssbam110.atom_def " + "WHERE " + "Id = " + Long.toString(Id) + " ";
            Statement stmt = cnx.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            int rowsAffected = stmt.executeUpdate(sql);
            if (rowsAffected != 1) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "Expected 1 row to be affected by delete, not " + rowsAffected);
            }
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamCursor openAtomDefCursorAll(MSSBamAuthorization Authorization) {
        String sql = "SELECT " + "anyo.ClassCode, " + "atm.Id, " + "atm.DbName, " + "atm.Revision "
                + "FROM mssbam110.atom_def AS atm " + "INNER JOIN mssbam110.any_obj anyo ON "

                + "atm.Id = anyo.Id " + "ORDER BY " + "anyo.Id ASC";
        MSSBamCursor cursor = new MSSBamPg8Cursor(Authorization, schema, sql);
        return (cursor);
    }

    public void closeAtomDefCursor(MSSBamCursor Cursor) {
        try {
            Cursor.getResultSet().close();
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), "closeAtomDefCursor", e);
        }
    }

    public MSSBamAtomDefBuff nextAtomDefCursor(MSSBamCursor Cursor) {
        final String S_ProcName = "nextAtomDefCursor";
        try {
            ResultSet resultSet = Cursor.getResultSet();
            if (!resultSet.next()) {
                throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                        "No more results available");
            }
            MSSBamAtomDefBuff buff = unpackAtomDefResultSetToBuff(resultSet);
            return (buff);
        } catch (SQLException e) {
            throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
    }

    public MSSBamAtomDefBuff prevAtomDefCursor(MSSBamCursor Cursor) {
        int targetRowIdx = (Cursor.getRowIdx() > 1) ? Cursor.getRowIdx() - 1 : 1;
        MSSBamAtomDefBuff buff = null;
        if (Cursor.getRowIdx() >= targetRowIdx) {
            Cursor.reset();
        }
        while (Cursor.getRowIdx() < targetRowIdx) {
            buff = nextAtomDefCursor(Cursor);
        }
        return (buff);
    }

    public MSSBamAtomDefBuff firstAtomDefCursor(MSSBamCursor Cursor) {
        int targetRowIdx = 1;
        MSSBamAtomDefBuff buff = null;
        Cursor.reset();
        while (Cursor.getRowIdx() < targetRowIdx) {
            buff = nextAtomDefCursor(Cursor);
        }
        return (buff);
    }

    public MSSBamAtomDefBuff lastAtomDefCursor(MSSBamCursor Cursor) {
        throw CFLib.getDefaultExceptionFactory().newNotImplementedYetException(getClass(), "lastAtomDefCursor");
    }

    public MSSBamAtomDefBuff nthAtomDefCursor(MSSBamCursor Cursor, int Idx) {
        int targetRowIdx = Idx;
        MSSBamAtomDefBuff buff = null;
        if (Cursor.getRowIdx() >= targetRowIdx) {
            Cursor.reset();
        }
        while (Cursor.getRowIdx() < targetRowIdx) {
            buff = nextAtomDefCursor(Cursor);
        }
        return (buff);
    }
}