Example usage for java.util ArrayList listIterator

List of usage examples for java.util ArrayList listIterator

Introduction

In this page you can find the example usage for java.util ArrayList listIterator.

Prototype

public ListIterator<E> listIterator() 

Source Link

Document

Returns a list iterator over the elements in this list (in proper sequence).

Usage

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BlobDefTable.java

public MSSBamBlobDefBuff[] readDerivedByNextIdx(MSSBamAuthorization Authorization, Long NextId) {
    final String S_ProcName = "readDerivedByNextIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from   ww  w  . j  a v a 2 s . c o  m*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBlobDefDistinctClassCode + "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<MSSBamBlobDefBuff> resultList = new ArrayList<MSSBamBlobDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BLB")) {
            MSSBamBlobDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamBlobDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8NmTokenDefTable.java

public MSSBamNmTokenDefBuff[] readDerivedByPrevIdx(MSSBamAuthorization Authorization, Long PrevId) {
    final String S_ProcName = "readDerivedByPrevIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*from  w  ww.  jav a2 s .  c om*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectNmTokenDefDistinctClassCode + "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<MSSBamNmTokenDefBuff> resultList = new ArrayList<MSSBamNmTokenDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("NMT")) {
            MSSBamNmTokenDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamNmTokenDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8NmTokenDefTable.java

public MSSBamNmTokenDefBuff[] readDerivedByNextIdx(MSSBamAuthorization Authorization, Long NextId) {
    final String S_ProcName = "readDerivedByNextIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from ww  w .  j  ava2s  .co  m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectNmTokenDefDistinctClassCode + "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<MSSBamNmTokenDefBuff> resultList = new ArrayList<MSSBamNmTokenDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("NMT")) {
            MSSBamNmTokenDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamNmTokenDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8StringDefTable.java

public MSSBamStringDefBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) {
    final String S_ProcName = "readDerivedByScopeIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from  ww w .  jav  a  2s.co m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectStringDefDistinctClassCode + "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<MSSBamStringDefBuff> resultList = new ArrayList<MSSBamStringDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("STR")) {
            MSSBamStringDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamStringDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8NmTokensDefTable.java

public MSSBamNmTokensDefBuff[] readDerivedByPrevIdx(MSSBamAuthorization Authorization, Long PrevId) {
    final String S_ProcName = "readDerivedByPrevIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }// w ww. java 2  s  .  co  m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectNmTokensDefDistinctClassCode + "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<MSSBamNmTokensDefBuff> resultList = new ArrayList<MSSBamNmTokensDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("NMS")) {
            MSSBamNmTokensDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamNmTokensDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8NmTokensDefTable.java

public MSSBamNmTokensDefBuff[] readDerivedByNextIdx(MSSBamAuthorization Authorization, Long NextId) {
    final String S_ProcName = "readDerivedByNextIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from  w w w .j a va 2s  .  c  o  m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectNmTokensDefDistinctClassCode + "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<MSSBamNmTokensDefBuff> resultList = new ArrayList<MSSBamNmTokensDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("NMS")) {
            MSSBamNmTokensDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamNmTokensDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8NmTokenDefTable.java

public MSSBamNmTokenDefBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) {
    final String S_ProcName = "readDerivedByScopeIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from   w  w w .j  av  a 2  s  .c om
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectNmTokenDefDistinctClassCode + "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<MSSBamNmTokenDefBuff> resultList = new ArrayList<MSSBamNmTokenDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("NMT")) {
            MSSBamNmTokenDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamNmTokenDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8BlobDefTable.java

public MSSBamBlobDefBuff[] readDerivedByScopeIdx(MSSBamAuthorization Authorization, Long ScopeId) {
    final String S_ProcName = "readDerivedByScopeIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/* w ww .  ja  v a 2  s  . c  o  m*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectBlobDefDistinctClassCode + "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<MSSBamBlobDefBuff> resultList = new ArrayList<MSSBamBlobDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BLB")) {
            MSSBamBlobDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamBlobDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8EnumDefTable.java

public MSSBamEnumDefBuff[] readDerivedByAuthorIdx(MSSBamAuthorization Authorization, Long AuthorId) {
    final String S_ProcName = "readDerivedByAuthorIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*  w w w .j  a va  2  s  .co  m*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectEnumDefDistinctClassCode + "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<MSSBamEnumDefBuff> resultList = new ArrayList<MSSBamEnumDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("ENM")) {
            MSSBamEnumDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamEnumDefBuff[0]));

}

From source file:net.sourceforge.msscodefactory.v1_10.MSSBamPg8.MSSBamPg8FloatDefTable.java

public MSSBamFloatDefBuff[] readDerivedByPrevIdx(MSSBamAuthorization Authorization, Long PrevId) {
    final String S_ProcName = "readDerivedByPrevIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//w w  w .  j  a  v  a  2 s . c  o m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectFloatDefDistinctClassCode + "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<MSSBamFloatDefBuff> resultList = new ArrayList<MSSBamFloatDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("FLT")) {
            MSSBamFloatDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamFloatDefBuff[0]));

}