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.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWProjectBaseTable.java

public CFAccProjectBaseBuff[] readDerivedByTenantIdx(CFAccAuthorization 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 av a2  s . co  m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_read_bprjdef_cc_by_tenantidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFAccProjectBaseBuff> resultList = new LinkedList<CFAccProjectBaseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BPRJ")) {
            CFAccProjectBaseBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("RPRJ")) {
            CFAccRealProjectBuff[] subList = schema.getTableRealProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFAccTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFAccSubProjectBuff[] subList = schema.getTableSubProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VERN")) {
            CFAccVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJVR")) {
            CFAccMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNVR")) {
            CFAccMinorVersionBuff[] subList = schema.getTableMinorVersion().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 + "\"");
        }
    }
    int idx = 0;
    CFAccProjectBaseBuff[] retBuff = new CFAccProjectBaseBuff[resultList.size()];
    Iterator<CFAccProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstDb2LUW.CFAstDb2LUWProjectBaseTable.java

public CFAstProjectBaseBuff[] readDerivedByTenantIdx(CFAstAuthorization Authorization, long TenantId) {
    final String S_ProcName = "readDerivedByTenantIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*  w  w w  .  j a v  a 2s  .  c om*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_read_bprjdef_cc_by_tenantidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFAstProjectBaseBuff> resultList = new LinkedList<CFAstProjectBaseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BPRJ")) {
            CFAstProjectBaseBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("RPRJ")) {
            CFAstRealProjectBuff[] subList = schema.getTableRealProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFAstTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFAstSubProjectBuff[] subList = schema.getTableSubProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VERN")) {
            CFAstVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJVR")) {
            CFAstMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNVR")) {
            CFAstMinorVersionBuff[] subList = schema.getTableMinorVersion().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 + "\"");
        }
    }
    int idx = 0;
    CFAstProjectBaseBuff[] retBuff = new CFAstProjectBaseBuff[resultList.size()];
    Iterator<CFAstProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMSSql.CFAsteriskMSSqlRealProjectTable.java

public CFInternetRealProjectBuff[] readDerivedByTenantIdx(CFSecurityAuthorization Authorization,
        long TenantId) {
    final String S_ProcName = "readDerivedByTenantIdx";
    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;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        String sql = "{ call sp_read_rprjdef_cc_by_tenantidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        if (resultSet != null) {
            while (resultSet.next()) {
                classCode = resultSet.getString(1);
                classCodeList.add(classCode);
            }
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFInternetRealProjectBuff> resultList = new LinkedList<CFInternetRealProjectBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("RPRJ")) {
            CFInternetRealProjectBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFInternetTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFInternetSubProjectBuff[] subList = schema.getTableSubProject().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 + "\"");
        }
    }
    int idx = 0;
    CFInternetRealProjectBuff[] retBuff = new CFInternetRealProjectBuff[resultList.size()];
    Iterator<CFInternetRealProjectBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_1.CFInternetDb2LUW.CFInternetDb2LUWProjectBaseTable.java

public CFInternetProjectBaseBuff[] readDerivedByTenantIdx(CFInternetAuthorization Authorization,
        long TenantId) {
    final String S_ProcName = "readDerivedByTenantIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }/*w  w  w. j  ava2  s  . c  o  m*/
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_read_bprjdef_cc_by_tenantidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFInternetProjectBaseBuff> resultList = new LinkedList<CFInternetProjectBaseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BPRJ")) {
            CFInternetProjectBaseBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("RPRJ")) {
            CFInternetRealProjectBuff[] subList = schema.getTableRealProject()
                    .readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFInternetTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFInternetSubProjectBuff[] subList = schema.getTableSubProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VERN")) {
            CFInternetVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJVR")) {
            CFInternetMajorVersionBuff[] subList = schema.getTableMajorVersion()
                    .readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNVR")) {
            CFInternetMinorVersionBuff[] subList = schema.getTableMinorVersion()
                    .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 + "\"");
        }
    }
    int idx = 0;
    CFInternetProjectBaseBuff[] retBuff = new CFInternetProjectBaseBuff[resultList.size()];
    Iterator<CFInternetProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskDb2LUW.CFAsteriskDb2LUWProjectBaseTable.java

public CFInternetProjectBaseBuff[] readDerivedByTenantIdx(CFSecurityAuthorization Authorization,
        long TenantId) {
    final String S_ProcName = "readDerivedByTenantIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from  ww w . jav  a 2 s  . com
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_read_bprjdef_cc_by_tenantidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFInternetProjectBaseBuff> resultList = new LinkedList<CFInternetProjectBaseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BPRJ")) {
            CFInternetProjectBaseBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("RPRJ")) {
            CFInternetRealProjectBuff[] subList = schema.getTableRealProject()
                    .readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFInternetTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFInternetSubProjectBuff[] subList = schema.getTableSubProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VERN")) {
            CFInternetVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJVR")) {
            CFInternetMajorVersionBuff[] subList = schema.getTableMajorVersion()
                    .readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNVR")) {
            CFInternetMinorVersionBuff[] subList = schema.getTableMinorVersion()
                    .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 + "\"");
        }
    }
    int idx = 0;
    CFInternetProjectBaseBuff[] retBuff = new CFInternetProjectBaseBuff[resultList.size()];
    Iterator<CFInternetProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstSybase.CFAstSybaseProjectBaseTable.java

public CFAstProjectBaseBuff[] readDerivedByTenantIdx(CFAstAuthorization 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;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        String sql = "exec sp_read_bprjdef_cc_by_tenantidx ?, ?, ?, ?, ?" + ", " + "?";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFAstProjectBaseBuff> resultList = new LinkedList<CFAstProjectBaseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BPRJ")) {
            CFAstProjectBaseBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("RPRJ")) {
            CFAstRealProjectBuff[] subList = schema.getTableRealProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFAstTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFAstSubProjectBuff[] subList = schema.getTableSubProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VERN")) {
            CFAstVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJVR")) {
            CFAstMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNVR")) {
            CFAstMinorVersionBuff[] subList = schema.getTableMinorVersion().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 + "\"");
        }
    }
    int idx = 0;
    CFAstProjectBaseBuff[] retBuff = new CFAstProjectBaseBuff[resultList.size()];
    Iterator<CFAstProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_1.CFInternetSybase.CFInternetSybaseProjectBaseTable.java

public CFInternetProjectBaseBuff[] readDerivedByTenantIdx(CFInternetAuthorization Authorization,
        long TenantId) {
    final String S_ProcName = "readDerivedByTenantIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//  w  w w  .  j a v a 2 s  . c om
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        String sql = "exec sp_read_bprjdef_cc_by_tenantidx ?, ?, ?, ?, ?" + ", " + "?";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFInternetProjectBaseBuff> resultList = new LinkedList<CFInternetProjectBaseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BPRJ")) {
            CFInternetProjectBaseBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("RPRJ")) {
            CFInternetRealProjectBuff[] subList = schema.getTableRealProject()
                    .readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFInternetTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFInternetSubProjectBuff[] subList = schema.getTableSubProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VERN")) {
            CFInternetVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJVR")) {
            CFInternetMajorVersionBuff[] subList = schema.getTableMajorVersion()
                    .readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNVR")) {
            CFInternetMinorVersionBuff[] subList = schema.getTableMinorVersion()
                    .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 + "\"");
        }
    }
    int idx = 0;
    CFInternetProjectBaseBuff[] retBuff = new CFInternetProjectBaseBuff[resultList.size()];
    Iterator<CFInternetProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSybase.CFAsteriskSybaseProjectBaseTable.java

public CFInternetProjectBaseBuff[] readDerivedByTenantIdx(CFSecurityAuthorization Authorization,
        long TenantId) {
    final String S_ProcName = "readDerivedByTenantIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//from  w  w w  . j ava2  s .  co  m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        String sql = "exec sp_read_bprjdef_cc_by_tenantidx ?, ?, ?, ?, ?" + ", " + "?";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFInternetProjectBaseBuff> resultList = new LinkedList<CFInternetProjectBaseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BPRJ")) {
            CFInternetProjectBaseBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("RPRJ")) {
            CFInternetRealProjectBuff[] subList = schema.getTableRealProject()
                    .readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFInternetTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFInternetSubProjectBuff[] subList = schema.getTableSubProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VERN")) {
            CFInternetVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJVR")) {
            CFInternetMajorVersionBuff[] subList = schema.getTableMajorVersion()
                    .readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNVR")) {
            CFInternetMinorVersionBuff[] subList = schema.getTableMinorVersion()
                    .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 + "\"");
        }
    }
    int idx = 0;
    CFInternetProjectBaseBuff[] retBuff = new CFInternetProjectBaseBuff[resultList.size()];
    Iterator<CFInternetProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmDb2LUW.CFCrmDb2LUWDomainBaseTable.java

public CFCrmDomainBaseBuff[] readDerivedByTenantIdx(CFCrmAuthorization Authorization, long TenantId) {
    final String S_ProcName = "readDerivedByTenantIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//w ww . j a v a2  s.  c  o m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        final String sql = "CALL sp_read_bdomdef_cc_by_tenantidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFCrmDomainBaseBuff> resultList = new LinkedList<CFCrmDomainBaseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BDOM")) {
            CFCrmDomainBaseBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TDOM")) {
            CFCrmTopDomainBuff[] subList = schema.getTableTopDomain().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("DOMN")) {
            CFCrmDomainBuff[] subList = schema.getTableDomain().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("BPRJ")) {
            CFCrmProjectBaseBuff[] subList = schema.getTableProjectBase().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("RPRJ")) {
            CFCrmRealProjectBuff[] subList = schema.getTableRealProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFCrmTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFCrmSubProjectBuff[] subList = schema.getTableSubProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VERN")) {
            CFCrmVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJVR")) {
            CFCrmMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNVR")) {
            CFCrmMinorVersionBuff[] subList = schema.getTableMinorVersion().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 + "\"");
        }
    }
    int idx = 0;
    CFCrmDomainBaseBuff[] retBuff = new CFCrmDomainBaseBuff[resultList.size()];
    Iterator<CFCrmDomainBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccPgSql.CFAccPgSqlProjectBaseTable.java

public CFAccProjectBaseBuff[] readDerivedByTenantIdx(CFAccAuthorization Authorization, long TenantId) {
    final String S_ProcName = "readDerivedByTenantIdx";
    if (!schema.isTransactionOpen()) {
        throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName,
                "Transaction not open");
    }//w ww .  j a  v  a  2s .c o  m
    ArrayList<String> classCodeList = new ArrayList<String>();
    String classCode;
    ResultSet resultSet = null;
    try {
        Connection cnx = schema.getCnx();
        String sql = "SELECT * FROM " + schema.getLowerSchemaDbName()
                + ".sp_read_bprjdef_cc_by_tenantidx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
        if (stmtReadClassCodeByTenantIdx == null) {
            stmtReadClassCodeByTenantIdx = cnx.prepareStatement(sql);
        }
        int argIdx = 1;
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecUserId().toString());
        stmtReadClassCodeByTenantIdx.setString(argIdx++,
                (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecClusterId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++,
                (Authorization == null) ? 0 : Authorization.getSecTenantId());
        stmtReadClassCodeByTenantIdx.setLong(argIdx++, TenantId);
        resultSet = stmtReadClassCodeByTenantIdx.executeQuery();
        while (resultSet.next()) {
            classCode = resultSet.getString(1);
            classCodeList.add(classCode);
        }
    } catch (SQLException e) {
        throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
        if (resultSet != null) {
            try {
                resultSet.close();
            } catch (SQLException e) {
            }
            resultSet = null;
        }
    }
    List<CFAccProjectBaseBuff> resultList = new LinkedList<CFAccProjectBaseBuff>();
    ListIterator<String> classCodeIter = classCodeList.listIterator();
    while (classCodeIter.hasNext()) {
        classCode = classCodeIter.next();
        if (classCode.equals("BPRJ")) {
            CFAccProjectBaseBuff[] subList = readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("RPRJ")) {
            CFAccRealProjectBuff[] subList = schema.getTableRealProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("TPRJ")) {
            CFAccTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("SPRJ")) {
            CFAccSubProjectBuff[] subList = schema.getTableSubProject().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("VERN")) {
            CFAccVersionBuff[] subList = schema.getTableVersion().readBuffByTenantIdx(Authorization, TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MJVR")) {
            CFAccMajorVersionBuff[] subList = schema.getTableMajorVersion().readBuffByTenantIdx(Authorization,
                    TenantId);
            for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) {
                resultList.add(subList[subListIdx]);
            }
        } else if (classCode.equals("MNVR")) {
            CFAccMinorVersionBuff[] subList = schema.getTableMinorVersion().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 + "\"");
        }
    }
    int idx = 0;
    CFAccProjectBaseBuff[] retBuff = new CFAccProjectBaseBuff[resultList.size()];
    Iterator<CFAccProjectBaseBuff> iter = resultList.iterator();
    while (iter.hasNext()) {
        retBuff[idx++] = iter.next();
    }
    return (retBuff);

}