public void deleteTSecGroupByUNameIdx(
     CFSecurityAuthorization Authorization, long TenantId, String Name) {
   final String S_ProcName = "deleteTSecGroupByUNameIdx";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql = "exec sp_delete_tsecgrp_by_unameidx ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     if (stmtDeleteByUNameIdx == null) {
       stmtDeleteByUNameIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByUNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUNameIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByUNameIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByUNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtDeleteByUNameIdx.setLong(argIdx++, TenantId);
     stmtDeleteByUNameIdx.setString(argIdx++, Name);
     Object stuff = null;
     boolean moreResults = stmtDeleteByUNameIdx.execute();
     while (stuff == null) {
       try {
         moreResults = stmtDeleteByUNameIdx.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           stuff = stmtDeleteByUNameIdx.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtDeleteByUNameIdx.getUpdateCount()) {
         break;
       }
     }
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public CFSecurityTSecGroupBuff lockBuff(
     CFSecurityAuthorization Authorization, CFSecurityTSecGroupPKey PKey) {
   final String S_ProcName = "lockBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     long TenantId = PKey.getRequiredTenantId();
     int TSecGroupId = PKey.getRequiredTSecGroupId();
     String sql = "exec sp_lock_tsecgrp ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     if (stmtLockBuffByPKey == null) {
       stmtLockBuffByPKey = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtLockBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtLockBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtLockBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtLockBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtLockBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtLockBuffByPKey.setLong(argIdx++, TenantId);
     stmtLockBuffByPKey.setInt(argIdx++, TSecGroupId);
     resultSet = stmtLockBuffByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecurityTSecGroupBuff buff = unpackTSecGroupResultSetToBuff(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) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public CFSecurityTSecGroupBuff readBuffByUNameIdx(
     CFSecurityAuthorization Authorization, long TenantId, String Name) {
   final String S_ProcName = "readBuffByUNameIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql = "exec sp_read_tsecgrp_by_unameidx ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     if (stmtReadBuffByUNameIdx == null) {
       stmtReadBuffByUNameIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByUNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUNameIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByUNameIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByUNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByUNameIdx.setLong(argIdx++, TenantId);
     stmtReadBuffByUNameIdx.setString(argIdx++, Name);
     resultSet = stmtReadBuffByUNameIdx.executeQuery();
     if (resultSet.next()) {
       CFSecurityTSecGroupBuff buff = unpackTSecGroupResultSetToBuff(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) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public CFSecurityTSecGroupBuff[] readAllBuff(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql = "exec sp_read_tsecgrp_all ?, ?, ?, ?, ?";
     if (stmtReadAllBuff == null) {
       stmtReadAllBuff = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     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());
     resultSet = stmtReadAllBuff.executeQuery();
     List<CFSecurityTSecGroupBuff> buffList = new LinkedList<CFSecurityTSecGroupBuff>();
     while (resultSet.next()) {
       CFSecurityTSecGroupBuff buff = unpackTSecGroupResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecurityTSecGroupBuff[] retBuff = new CFSecurityTSecGroupBuff[buffList.size()];
     Iterator<CFSecurityTSecGroupBuff> 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;
     }
   }
 }
  public void deleteTSecGroup(CFSecurityAuthorization Authorization, CFSecurityTSecGroupBuff Buff) {
    final String S_ProcName = "deleteTSecGroup";
    try {
      Connection cnx = schema.getCnx();
      long TenantId = Buff.getRequiredTenantId();
      int TSecGroupId = Buff.getRequiredTSecGroupId();

      String sql = "exec sp_delete_tsecgrp ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?";
      if (stmtDeleteByPKey == null) {
        stmtDeleteByPKey = cnx.prepareStatement(sql);
      }
      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.setInt(argIdx++, TSecGroupId);
      stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision());
      ;
      Object stuff = null;
      boolean moreResults = stmtDeleteByPKey.execute();
      while (stuff == null) {
        try {
          moreResults = stmtDeleteByPKey.getMoreResults();
        } catch (SQLException e) {
          throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
        }
        if (moreResults) {
          try {
            stuff = stmtDeleteByPKey.getResultSet();
          } catch (SQLException e) {
          }
        } else if (-1 == stmtDeleteByPKey.getUpdateCount()) {
          break;
        }
      }
    } catch (SQLException e) {
      throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    }
  }
 public void deleteAuditAction(
     CFSecurityAuthorization Authorization, CFSecurityAuditActionBuff Buff) {
   final String S_ProcName = "deleteAuditAction";
   Connection cnx = schema.getCnx();
   CallableStatement stmtDeleteByPKey = null;
   try {
     short AuditActionId = Buff.getRequiredAuditActionId();
     stmtDeleteByPKey =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".dl_auditaction( ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + " ); 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.setShort(argIdx++, AuditActionId);
     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 deleteAuditActionByUDescrIdx(
     CFSecurityAuthorization Authorization, String argDescription) {
   final String S_ProcName = "deleteAuditActionByUDescrIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "begin call "
             + schema.getLowerDbSchemaName()
             + ".dl_auditactionbyudescridx( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + " ); end";
     if (stmtDeleteByUDescrIdx == null) {
       stmtDeleteByUDescrIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByUDescrIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUDescrIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByUDescrIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByUDescrIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUDescrIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtDeleteByUDescrIdx.setString(argIdx++, argDescription);
     int rowsUpdated = stmtDeleteByUDescrIdx.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 void updateAuditAction(
     CFSecurityAuthorization Authorization, CFSecurityAuditActionBuff Buff) {
   final String S_ProcName = "updateAuditAction";
   ResultSet resultSet = null;
   Connection cnx = schema.getCnx();
   CallableStatement stmtUpdateByPKey = null;
   List<CFSecurityAuditActionBuff> buffList = new LinkedList<CFSecurityAuditActionBuff>();
   try {
     short AuditActionId = Buff.getRequiredAuditActionId();
     String Description = Buff.getRequiredDescription();
     int Revision = Buff.getRequiredRevision();
     stmtUpdateByPKey =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".upd_auditaction( ?, ?, ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + ", "
                 + "? ); 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++, "AUDT");
     stmtUpdateByPKey.setShort(argIdx++, AuditActionId);
     stmtUpdateByPKey.setString(argIdx++, Description);
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     stmtUpdateByPKey.execute();
     resultSet = (ResultSet) stmtUpdateByPKey.getObject(1);
     if (resultSet != null) {
       try {
         if (resultSet.next()) {
           CFSecurityAuditActionBuff updatedBuff = unpackAuditActionResultSetToBuff(resultSet);
           if (resultSet.next()) {
             resultSet.last();
             throw CFLib.getDefaultExceptionFactory()
                 .newRuntimeException(
                     getClass(),
                     S_ProcName,
                     "Did not expect multi-record response, "
                         + resultSet.getRow()
                         + " rows selected");
           }
           Buff.setRequiredDescription(updatedBuff.getRequiredDescription());
           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_auditaction() 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_auditaction() 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 CFSecurityAuditActionBuff readBuffByUDescrIdx(
     CFSecurityAuthorization Authorization, String Description) {
   final String S_ProcName = "readBuffByUDescrIdx";
   ResultSet resultSet = null;
   Connection cnx = schema.getCnx();
   CallableStatement stmtReadBuffByUDescrIdx = null;
   try {
     stmtReadBuffByUDescrIdx =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".rd_auditactionbyudescridx( ?, ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + " ); end;");
     int argIdx = 1;
     stmtReadBuffByUDescrIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
     stmtReadBuffByUDescrIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUDescrIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByUDescrIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByUDescrIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUDescrIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByUDescrIdx.setString(argIdx++, Description);
     stmtReadBuffByUDescrIdx.execute();
     resultSet = (ResultSet) stmtReadBuffByUDescrIdx.getObject(1);
     if (resultSet == null) {
       return (null);
     }
     try {
       if (resultSet.next()) {
         CFSecurityAuditActionBuff buff = unpackAuditActionResultSetToBuff(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 (stmtReadBuffByUDescrIdx != null) {
       try {
         stmtReadBuffByUDescrIdx.close();
       } catch (SQLException e) {
       }
       stmtReadBuffByUDescrIdx = null;
     }
   }
 }
 public CFSecurityAuditActionBuff[] 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 {
     CFSecurityAuditActionBuff buff = null;
     List<CFSecurityAuditActionBuff> buffList = new LinkedList<CFSecurityAuditActionBuff>();
     stmtReadAllBuff =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".rd_auditactionall( ?, ?, ?, ?, ?, ? ) ); 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 = unpackAuditActionResultSetToBuff(resultSet);
           buffList.add(buff);
         }
       } catch (SQLException e) {
         // Oracle may return an invalid resultSet if the rowset is empty
       }
     }
     int idx = 0;
     CFSecurityAuditActionBuff[] retBuff = new CFSecurityAuditActionBuff[buffList.size()];
     Iterator<CFSecurityAuditActionBuff> 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;
     }
   }
 }
  public CFSecurityAuditActionBuff lockBuff(
      CFSecurityAuthorization Authorization, CFSecurityAuditActionPKey PKey) {
    final String S_ProcName = "lockBuff";
    if (!schema.isTransactionOpen()) {
      throw CFLib.getDefaultExceptionFactory()
          .newUsageException(getClass(), S_ProcName, "Transaction not open");
    }
    ResultSet resultSet = null;
    Connection cnx = schema.getCnx();
    CallableStatement stmtLockBuffByPKey = null;
    try {
      short AuditActionId = PKey.getRequiredAuditActionId();

      stmtLockBuffByPKey =
          cnx.prepareCall(
              "begin "
                  + schema.getLowerDbSchemaName()
                  + ".lck_auditaction( ?, ?, ?, ?, ?, ?"
                  + ", "
                  + "?"
                  + " ); end;");
      int argIdx = 1;
      stmtLockBuffByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
      stmtLockBuffByPKey.setLong(
          argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
      stmtLockBuffByPKey.setString(
          argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
      stmtLockBuffByPKey.setString(
          argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
      stmtLockBuffByPKey.setLong(
          argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
      stmtLockBuffByPKey.setLong(
          argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
      stmtLockBuffByPKey.setShort(argIdx++, AuditActionId);
      stmtLockBuffByPKey.execute();
      resultSet = (ResultSet) stmtLockBuffByPKey.getObject(1);
      if (resultSet == null) {
        return (null);
      }
      try {
        if (resultSet.next()) {
          CFSecurityAuditActionBuff buff = unpackAuditActionResultSetToBuff(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 (stmtLockBuffByPKey != null) {
        try {
          stmtLockBuffByPKey.close();
        } catch (SQLException e) {
        }
        stmtLockBuffByPKey = null;
      }
    }
  }
 public void updateTSecGroup(CFSecurityAuthorization Authorization, CFSecurityTSecGroupBuff Buff) {
   final String S_ProcName = "updateTSecGroup";
   ResultSet resultSet = null;
   try {
     long TenantId = Buff.getRequiredTenantId();
     int TSecGroupId = Buff.getRequiredTSecGroupId();
     String Name = Buff.getRequiredName();
     int Revision = Buff.getRequiredRevision();
     Connection cnx = schema.getCnx();
     String sql =
         "exec sp_update_tsecgrp ?, ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?";
     if (stmtUpdateByPKey == null) {
       stmtUpdateByPKey = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     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++, "TGRP");
     stmtUpdateByPKey.setLong(argIdx++, TenantId);
     stmtUpdateByPKey.setInt(argIdx++, TSecGroupId);
     stmtUpdateByPKey.setString(argIdx++, Name);
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     resultSet = stmtUpdateByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecurityTSecGroupBuff updatedBuff = unpackTSecGroupResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredName(updatedBuff.getRequiredName());
       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().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }