protected CFAccFeeDetailBuff unpackFeeDetailResultSetToBuff(ResultSet resultSet)
      throws SQLException {
    final String S_ProcName = "unpackFeeDetailResultSetToBuff";
    int idxcol = 1;
    CFAccFeeDetailBuff buff = schema.getFactoryFeeDetail().newBuff();
    {
      String colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setCreatedByUserId(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setCreatedByUserId(null);
      } else {
        buff.setCreatedByUserId(UUID.fromString(colString));
      }
      idxcol++;

      colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setCreatedAt(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setCreatedAt(null);
      } else {
        buff.setCreatedAt(CFAccOracleSchema.convertTimestampString(colString));
      }
      idxcol++;
      colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setUpdatedByUserId(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setUpdatedByUserId(null);
      } else {
        buff.setUpdatedByUserId(UUID.fromString(colString));
      }
      idxcol++;

      colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setUpdatedAt(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setUpdatedAt(null);
      } else {
        buff.setUpdatedAt(CFAccOracleSchema.convertTimestampString(colString));
      }
      idxcol++;
    }
    buff.setRequiredTenantId(resultSet.getLong(idxcol));
    idxcol++;
    buff.setRequiredFeeId(resultSet.getLong(idxcol));
    idxcol++;
    buff.setRequiredFeeDetailId(resultSet.getLong(idxcol));
    idxcol++;
    buff.setRequiredDescription(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredAmountCharged(resultSet.getBigDecimal(idxcol));
    idxcol++;
    buff.setRequiredRevision(resultSet.getInt(idxcol));
    return (buff);
  }
 public void deleteFeeDetail(CFSecurityAuthorization Authorization, CFAccFeeDetailBuff Buff) {
   final String S_ProcName = "deleteFeeDetail";
   Connection cnx = schema.getCnx();
   CallableStatement stmtDeleteByPKey = null;
   try {
     long TenantId = Buff.getRequiredTenantId();
     long FeeDetailId = Buff.getRequiredFeeDetailId();
     stmtDeleteByPKey =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".dl_feedtl( ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + " ); end;");
     int argIdx = 1;
     stmtDeleteByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtDeleteByPKey.setLong(argIdx++, TenantId);
     stmtDeleteByPKey.setLong(argIdx++, FeeDetailId);
     stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision());
     ;
     stmtDeleteByPKey.execute();
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (stmtDeleteByPKey != null) {
       try {
         stmtDeleteByPKey.close();
       } catch (SQLException e) {
       }
       stmtDeleteByPKey = null;
     }
   }
 }
 public void deleteFeeDetailByIdIdx(
     CFSecurityAuthorization Authorization, long argTenantId, long argFeeDetailId) {
   final String S_ProcName = "deleteFeeDetailByIdIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "begin call "
             + schema.getLowerDbSchemaName()
             + ".dl_feedtlbyididx( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " ); end";
     if (stmtDeleteByIdIdx == null) {
       stmtDeleteByIdIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByIdIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByIdIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByIdIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByIdIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByIdIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtDeleteByIdIdx.setLong(argIdx++, argTenantId);
     stmtDeleteByIdIdx.setLong(argIdx++, argFeeDetailId);
     int rowsUpdated = stmtDeleteByIdIdx.executeUpdate();
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public CFAccFeeDetailBuff[] readDerivedByFeeIdx(
     CFSecurityAuthorization Authorization, long TenantId, long FeeId) {
   final String S_ProcName = "readDerivedByFeeIdx";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFAccFeeDetailBuff[] buffList = readBuffByFeeIdx(Authorization, TenantId, FeeId);
   return (buffList);
 }
 public CFAccFeeDetailBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllDerived";
   CFAccFeeDetailBuff[] buffArray;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buffArray = readAllBuff(Authorization);
   return (buffArray);
 }
 public CFAccFeeDetailBuff readDerivedByIdIdx(
     CFSecurityAuthorization Authorization, long TenantId, long FeeDetailId) {
   final String S_ProcName = "CFAccOracleFeeDetailTable.readDerivedByIdIdx() ";
   CFAccFeeDetailBuff buff;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buff = readBuffByIdIdx(Authorization, TenantId, FeeDetailId);
   return (buff);
 }
 public CFAccFeeDetailBuff lockDerived(
     CFSecurityAuthorization Authorization, CFAccFeeDetailPKey PKey) {
   final String S_ProcName = "lockDerived";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFAccFeeDetailBuff buff;
   buff = lockBuff(Authorization, PKey);
   return (buff);
 }
 public String getSqlSelectFeeDetailDistinctClassCode() {
   if (S_sqlSelectFeeDetailDistinctClassCode == null) {
     S_sqlSelectFeeDetailDistinctClassCode =
         "SELECT "
             + "DISTINCT fedt.ClassCode "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + ".feedtl fedt ";
   }
   return (S_sqlSelectFeeDetailDistinctClassCode);
 }
 public String getSqlSelectFeeDetailBuff() {
   if (S_sqlSelectFeeDetailBuff == null) {
     S_sqlSelectFeeDetailBuff =
         "SELECT "
             + "fedt.TenantId, "
             + "fedt.FeeDetailId, "
             + "fedt.FeeId, "
             + "fedt.Description, "
             + "fedt.amt_chg, "
             + "fedt.Revision "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + ".feedtl fedt ";
   }
   return (S_sqlSelectFeeDetailBuff);
 }
 public void updateFeeDetail(CFSecurityAuthorization Authorization, CFAccFeeDetailBuff Buff) {
   final String S_ProcName = "updateFeeDetail";
   ResultSet resultSet = null;
   Connection cnx = schema.getCnx();
   CallableStatement stmtUpdateByPKey = null;
   List<CFAccFeeDetailBuff> buffList = new LinkedList<CFAccFeeDetailBuff>();
   try {
     long TenantId = Buff.getRequiredTenantId();
     long FeeId = Buff.getRequiredFeeId();
     long FeeDetailId = Buff.getRequiredFeeDetailId();
     String Description = Buff.getRequiredDescription();
     BigDecimal AmountCharged = Buff.getRequiredAmountCharged();
     int Revision = Buff.getRequiredRevision();
     stmtUpdateByPKey =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".upd_feedtl( ?, ?, ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + ", "
                 + "? ); end;");
     int argIdx = 1;
     stmtUpdateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
     stmtUpdateByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtUpdateByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtUpdateByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtUpdateByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtUpdateByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtUpdateByPKey.setString(argIdx++, "FEDT");
     stmtUpdateByPKey.setLong(argIdx++, TenantId);
     stmtUpdateByPKey.setLong(argIdx++, FeeId);
     stmtUpdateByPKey.setLong(argIdx++, FeeDetailId);
     stmtUpdateByPKey.setString(argIdx++, Description);
     stmtUpdateByPKey.setBigDecimal(argIdx++, AmountCharged);
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     stmtUpdateByPKey.execute();
     resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
     if (resultSet != null) {
       try {
         if (resultSet.next()) {
           CFAccFeeDetailBuff updatedBuff = unpackFeeDetailResultSetToBuff(resultSet);
           if (resultSet.next()) {
             resultSet.last();
             throw CFLib.getDefaultExceptionFactory()
                 .newRuntimeException(
                     getClass(),
                     S_ProcName,
                     "Did not expect multi-record response, "
                         + resultSet.getRow()
                         + " rows selected");
           }
           Buff.setRequiredFeeId(updatedBuff.getRequiredFeeId());
           Buff.setRequiredDescription(updatedBuff.getRequiredDescription());
           Buff.setRequiredAmountCharged(updatedBuff.getRequiredAmountCharged());
           Buff.setRequiredRevision(updatedBuff.getRequiredRevision());
         } else {
           throw CFLib.getDefaultExceptionFactory()
               .newRuntimeException(
                   getClass(),
                   S_ProcName,
                   "Expected a single-record response, " + resultSet.getRow() + " rows selected");
         }
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(), S_ProcName, "upd_feedtl() did not return a valid result cursor");
       } finally {
         if (resultSet != null) {
           try {
             resultSet.close();
           } catch (SQLException e) {
           }
           resultSet = null;
         }
       }
     } else {
       throw CFLib.getDefaultExceptionFactory()
           .newRuntimeException(
               getClass(), S_ProcName, "upd_feedtl() did not return a result cursor");
     }
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
     if (stmtUpdateByPKey != null) {
       try {
         stmtUpdateByPKey.close();
       } catch (SQLException e) {
       }
       stmtUpdateByPKey = null;
     }
   }
 }
 public CFAccFeeDetailBuff[] readBuffByFeeIdx(
     CFSecurityAuthorization Authorization, long TenantId, long FeeId) {
   final String S_ProcName = "readBuffByFeeIdx";
   ResultSet resultSet = null;
   Connection cnx = schema.getCnx();
   CallableStatement stmtReadBuffByFeeIdx = null;
   List<CFAccFeeDetailBuff> buffList = new LinkedList<CFAccFeeDetailBuff>();
   try {
     stmtReadBuffByFeeIdx =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".rd_feedtlbyfeeidx( ?, ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + " ); end;");
     int argIdx = 1;
     stmtReadBuffByFeeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
     stmtReadBuffByFeeIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByFeeIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByFeeIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByFeeIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByFeeIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByFeeIdx.setLong(argIdx++, TenantId);
     stmtReadBuffByFeeIdx.setLong(argIdx++, FeeId);
     stmtReadBuffByFeeIdx.execute();
     resultSet = (ResultSet) stmtReadBuffByFeeIdx.getObject(1);
     if (resultSet != null) {
       try {
         while (resultSet.next()) {
           CFAccFeeDetailBuff buff = unpackFeeDetailResultSetToBuff(resultSet);
           buffList.add(buff);
         }
         try {
           resultSet.close();
         } catch (SQLException e) {
         }
         resultSet = null;
       } catch (SQLException e) {
       }
     }
     int idx = 0;
     CFAccFeeDetailBuff[] retBuff = new CFAccFeeDetailBuff[buffList.size()];
     Iterator<CFAccFeeDetailBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
     if (stmtReadBuffByFeeIdx != null) {
       try {
         stmtReadBuffByFeeIdx.close();
       } catch (SQLException e) {
       }
       stmtReadBuffByFeeIdx = null;
     }
   }
 }
 public CFAccFeeDetailBuff readBuffByIdIdx(
     CFSecurityAuthorization Authorization, long TenantId, long FeeDetailId) {
   final String S_ProcName = "readBuffByIdIdx";
   ResultSet resultSet = null;
   Connection cnx = schema.getCnx();
   CallableStatement stmtReadBuffByIdIdx = null;
   try {
     stmtReadBuffByIdIdx =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".rd_feedtlbyididx( ?, ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + " ); end;");
     int argIdx = 1;
     stmtReadBuffByIdIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
     stmtReadBuffByIdIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByIdIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByIdIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByIdIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByIdIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByIdIdx.setLong(argIdx++, TenantId);
     stmtReadBuffByIdIdx.setLong(argIdx++, FeeDetailId);
     stmtReadBuffByIdIdx.execute();
     resultSet = (ResultSet) stmtReadBuffByIdIdx.getObject(1);
     if (resultSet == null) {
       return (null);
     }
     try {
       if (resultSet.next()) {
         CFAccFeeDetailBuff buff = unpackFeeDetailResultSetToBuff(resultSet);
         if (resultSet.next()) {
           resultSet.last();
           throw CFLib.getDefaultExceptionFactory()
               .newRuntimeException(
                   getClass(),
                   S_ProcName,
                   "Did not expect multi-record response, "
                       + resultSet.getRow()
                       + " rows selected");
         }
         return (buff);
       } else {
         return (null);
       }
     } catch (SQLException e) {
       return (null);
     }
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
     if (stmtReadBuffByIdIdx != null) {
       try {
         stmtReadBuffByIdIdx.close();
       } catch (SQLException e) {
       }
       stmtReadBuffByIdIdx = null;
     }
   }
 }
 public CFAccFeeDetailBuff[] readAllBuff(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   Connection cnx = schema.getCnx();
   CallableStatement stmtReadAllBuff = null;
   try {
     CFAccFeeDetailBuff buff = null;
     List<CFAccFeeDetailBuff> buffList = new LinkedList<CFAccFeeDetailBuff>();
     stmtReadAllBuff =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".rd_feedtlall( ?, ?, ?, ?, ?, ? ) ); end;");
     int argIdx = 1;
     stmtReadAllBuff.registerOutParameter(argIdx++, OracleTypes.CURSOR);
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadAllBuff.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadAllBuff.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadAllBuff.execute();
     resultSet = (ResultSet) stmtReadAllBuff.getObject(1);
     if (resultSet != null) {
       try {
         while (resultSet.next()) {
           buff = unpackFeeDetailResultSetToBuff(resultSet);
           buffList.add(buff);
         }
       } catch (SQLException e) {
         // Oracle may return an invalid resultSet if the rowset is empty
       }
     }
     int idx = 0;
     CFAccFeeDetailBuff[] retBuff = new CFAccFeeDetailBuff[buffList.size()];
     Iterator<CFAccFeeDetailBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
     if (stmtReadAllBuff != null) {
       try {
         stmtReadAllBuff.close();
       } catch (SQLException e) {
       }
       stmtReadAllBuff = null;
     }
   }
 }