List of usage examples for java.util ArrayList listIterator
public ListIterator<E> listIterator()
From source file:net.sourceforge.msscodefactory.cfinternet.v2_1.CFInternetOracle.CFInternetOracleVersionTable.java
public CFInternetVersionBuff[] readDerivedByTenantIdx(CFInternetAuthorization 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 a v a2 s. c om*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_verndefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = null; } } List<CFInternetVersionBuff> resultList = new LinkedList<CFInternetVersionBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("VERN")) { CFInternetVersionBuff[] subList = 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; CFInternetVersionBuff[] retBuff = new CFInternetVersionBuff[resultList.size()]; Iterator<CFInternetVersionBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskOracle.CFAsteriskOracleVersionTable.java
public CFInternetVersionBuff[] 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 .j a v a 2 s.c o m ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_verndefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = null; } } List<CFInternetVersionBuff> resultList = new LinkedList<CFInternetVersionBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("VERN")) { CFInternetVersionBuff[] subList = 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; CFInternetVersionBuff[] retBuff = new CFInternetVersionBuff[resultList.size()]; Iterator<CFInternetVersionBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleVersionTable.java
public CFAccVersionBuff[] readDerivedByTenantIdx(CFAccAuthorization 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 ava 2 s . c o m*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_verndefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = null; } } List<CFAccVersionBuff> resultList = new LinkedList<CFAccVersionBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("VERN")) { CFAccVersionBuff[] subList = 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; CFAccVersionBuff[] retBuff = new CFAccVersionBuff[resultList.size()]; Iterator<CFAccVersionBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleVersionTable.java
public CFAstVersionBuff[] 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 w w. j a v a 2s . co m ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_verndefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = null; } } List<CFAstVersionBuff> resultList = new LinkedList<CFAstVersionBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("VERN")) { CFAstVersionBuff[] subList = 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; CFAstVersionBuff[] retBuff = new CFAstVersionBuff[resultList.size()]; Iterator<CFAstVersionBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleVersionTable.java
public CFAstVersionBuff[] 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 .com ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_verndefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = null; } } List<CFAstVersionBuff> resultList = new LinkedList<CFAstVersionBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("VERN")) { CFAstVersionBuff[] subList = 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; CFAstVersionBuff[] retBuff = new CFAstVersionBuff[resultList.size()]; Iterator<CFAstVersionBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccOracle.CFAccOracleRealProjectTable.java
public CFAccRealProjectBuff[] 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 w w . j ava 2s. co m*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_rprjdefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = null; } } List<CFAccRealProjectBuff> resultList = new LinkedList<CFAccRealProjectBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("RPRJ")) { CFAccRealProjectBuff[] subList = 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 { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAccRealProjectBuff[] retBuff = new CFAccRealProjectBuff[resultList.size()]; Iterator<CFAccRealProjectBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstOracle.CFAstOracleRealProjectTable.java
public CFAstRealProjectBuff[] 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 a2 s . c om*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerSchemaDbName() + ".rd_rprjdefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = null; } } List<CFAstRealProjectBuff> resultList = new LinkedList<CFAstRealProjectBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("RPRJ")) { CFAstRealProjectBuff[] subList = 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 { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAstRealProjectBuff[] retBuff = new CFAstRealProjectBuff[resultList.size()]; Iterator<CFAstRealProjectBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstOracle.CFAstOracleRealProjectTable.java
public CFAstRealProjectBuff[] 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 w w .j a v a 2 s . c o m*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_rprjdefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = null; } } List<CFAstRealProjectBuff> resultList = new LinkedList<CFAstRealProjectBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("RPRJ")) { CFAstRealProjectBuff[] subList = 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 { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAstRealProjectBuff[] retBuff = new CFAstRealProjectBuff[resultList.size()]; Iterator<CFAstRealProjectBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswOracle.CFFswOracleRealProjectTable.java
public CFFswRealProjectBuff[] readDerivedByTenantIdx(CFFswAuthorization 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. co m*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_rprjdefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = null; } } List<CFFswRealProjectBuff> resultList = new LinkedList<CFFswRealProjectBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("RPRJ")) { CFFswRealProjectBuff[] subList = readBuffByTenantIdx(Authorization, TenantId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("TPRJ")) { CFFswTopProjectBuff[] subList = schema.getTableTopProject().readBuffByTenantIdx(Authorization, TenantId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("SPRJ")) { CFFswSubProjectBuff[] 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; CFFswRealProjectBuff[] retBuff = new CFFswRealProjectBuff[resultList.size()]; Iterator<CFFswRealProjectBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfinternet.v2_1.CFInternetOracle.CFInternetOracleRealProjectTable.java
public CFInternetRealProjectBuff[] readDerivedByTenantIdx(CFInternetAuthorization Authorization, long TenantId) { final String S_ProcName = "readDerivedByTenantIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//www. j a va 2 s .c o m ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; CallableStatement stmtReadClassCodeByTenantIdx = null; try { Connection cnx = schema.getCnx(); stmtReadClassCodeByTenantIdx = cnx.prepareCall("begin " + schema.getLowerDbSchemaName() + ".rd_rprjdefccbytenantidx( ?, ?, ?, ?, ?, ?" + ", " + "?" + " ); end;"); int argIdx = 1; stmtReadClassCodeByTenantIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR); 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); stmtReadClassCodeByTenantIdx.execute(); resultSet = (ResultSet) stmtReadClassCodeByTenantIdx.getObject(1); if (resultSet != null) { try { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } if (stmtReadClassCodeByTenantIdx != null) { try { stmtReadClassCodeByTenantIdx.close(); } catch (SQLException e) { } stmtReadClassCodeByTenantIdx = 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); }