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.MSSBamPg8Id32GenDefTable.java

public MSSBamId32GenDefBuff[] readDerivedByContPrevIdx(MSSBamAuthorization Authorization, long ValueContainerId,
        Long PrevId) {/*  ww  w.  java  2 s  .  c o m*/
    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_sqlSelectId32GenDefDistinctClassCode + "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<MSSBamId32GenDefBuff> resultList = new ArrayList<MSSBamId32GenDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("G32")) {
            MSSBamId32GenDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamId32GenDefBuff[0]));

}

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

public MSSBamId32GenDefBuff[] readDerivedByContNextIdx(MSSBamAuthorization Authorization, long ValueContainerId,
        Long NextId) {//  ww  w  .  j  a v  a2 s .c  om
    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_sqlSelectId32GenDefDistinctClassCode + "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<MSSBamId32GenDefBuff> resultList = new ArrayList<MSSBamId32GenDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("G32")) {
            MSSBamId32GenDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamId32GenDefBuff[0]));

}

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

public MSSBamId64GenDefBuff[] readDerivedByContPrevIdx(MSSBamAuthorization Authorization, long ValueContainerId,
        Long PrevId) {/*from  ww w  .  jav  a2 s  .c  o m*/
    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_sqlSelectId64GenDefDistinctClassCode + "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<MSSBamId64GenDefBuff> resultList = new ArrayList<MSSBamId64GenDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("G64")) {
            MSSBamId64GenDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamId64GenDefBuff[0]));

}

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

public MSSBamId64GenDefBuff[] readDerivedByContNextIdx(MSSBamAuthorization Authorization, long ValueContainerId,
        Long NextId) {// w  w w .j a  v a2s .c o m
    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_sqlSelectId64GenDefDistinctClassCode + "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<MSSBamId64GenDefBuff> resultList = new ArrayList<MSSBamId64GenDefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("G64")) {
            MSSBamId64GenDefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamId64GenDefBuff[0]));

}

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

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

}

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

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

}

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

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

}

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

public MSSBamInt64DefBuff[] readDerivedByVContIdx(MSSBamAuthorization Authorization, long ValueContainerId) {
    final String S_ProcName = "readDerivedByVContIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from  www  .ja v  a 2  s. c  om
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectInt64DefDistinctClassCode + "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<MSSBamInt64DefBuff> resultList = new ArrayList<MSSBamInt64DefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("I64")) {
            MSSBamInt64DefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamInt64DefBuff[0]));

}

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

public MSSBamInt32DefBuff[] 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 w w . j av  a 2 s .com
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectInt32DefDistinctClassCode + "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<MSSBamInt32DefBuff> resultList = new ArrayList<MSSBamInt32DefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("I32")) {
            MSSBamInt32DefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamInt32DefBuff[0]));

}

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

public MSSBamInt32DefBuff[] 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 v  a2  s  . c  o  m*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    try {
        Connection cnx = schema.getCnx();
        String sql = S_sqlSelectInt32DefDistinctClassCode + "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<MSSBamInt32DefBuff> resultList = new ArrayList<MSSBamInt32DefBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("I32")) {
            MSSBamInt32DefBuff[] subList = 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 {
            throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName,
                    "Did not expect ClassCode \"" + classCode + "\"");
        }
    }
    return (resultList.toArray(new MSSBamInt32DefBuff[0]));

}