public CFSecurityAuditActionBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllDerived";
   CFSecurityAuditActionBuff[] buffArray;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buffArray = readAllBuff(Authorization);
   return (buffArray);
 }
 public CFInternetTldBuff[] readDerivedByTenantIdx(
     CFSecurityAuthorization Authorization, long TenantId) {
   final String S_ProcName = "readDerivedByTenantIdx";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFInternetTldBuff[] buffList = readBuffByTenantIdx(Authorization, TenantId);
   return (buffList);
 }
 public CFSecurityAuditActionBuff readDerivedByUDescrIdx(
     CFSecurityAuthorization Authorization, String Description) {
   final String S_ProcName = "CFInternetOracleAuditActionTable.readDerivedByUDescrIdx() ";
   CFSecurityAuditActionBuff buff;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buff = readBuffByUDescrIdx(Authorization, Description);
   return (buff);
 }
 public CFSecurityAuditActionBuff lockDerived(
     CFSecurityAuthorization Authorization, CFSecurityAuditActionPKey PKey) {
   final String S_ProcName = "lockDerived";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFSecurityAuditActionBuff buff;
   buff = lockBuff(Authorization, PKey);
   return (buff);
 }
 public CFInternetTldBuff readDerivedByNameIdx(
     CFSecurityAuthorization Authorization, long TenantId, String Name) {
   final String S_ProcName = "CFInternetOracleTldTable.readDerivedByNameIdx() ";
   CFInternetTldBuff buff;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buff = readBuffByNameIdx(Authorization, TenantId, Name);
   return (buff);
 }
 public void createAuditAction(
     CFSecurityAuthorization Authorization, CFSecurityAuditActionBuff Buff) {
   final String S_ProcName = "createAuditAction";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   CallableStatement stmtCreateByPKey = null;
   try {
     ICFSecuritySchema.AuditActionEnum AuditActionId = Buff.getRequiredAuditActionId();
     String Description = Buff.getRequiredDescription();
     Connection cnx = schema.getCnx();
     stmtCreateByPKey =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".crt_auditaction( ?, ?, ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + " ); end;");
     int argIdx = 1;
     stmtCreateByPKey.registerOutParameter(argIdx++, OracleTypes.CURSOR);
     stmtCreateByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtCreateByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtCreateByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtCreateByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtCreateByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtCreateByPKey.setString(argIdx++, "AUDT");
     stmtCreateByPKey.setShort(argIdx++, (short) AuditActionId.ordinal());
     stmtCreateByPKey.setString(argIdx++, Description);
     stmtCreateByPKey.execute();
     resultSet = (ResultSet) stmtCreateByPKey.getObject(1);
     if (resultSet == null) {
       throw CFLib.getDefaultExceptionFactory()
           .newRuntimeException(
               getClass(), S_ProcName, "crt_auditaction() did not return a result set");
     }
     try {
       if (resultSet.next()) {
         CFSecurityAuditActionBuff createdBuff = 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.setRequiredAuditActionId(createdBuff.getRequiredAuditActionId());
         Buff.setRequiredDescription(createdBuff.getRequiredDescription());
         Buff.setRequiredRevision(createdBuff.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, "crt_auditaction() did not return a valid result set");
     }
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
     if (stmtCreateByPKey != null) {
       try {
         stmtCreateByPKey.close();
       } catch (SQLException e) {
       }
       stmtCreateByPKey = 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 CFInternetTldBuff lockBuff(CFSecurityAuthorization Authorization, CFInternetTldPKey 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 {
      long TenantId = PKey.getRequiredTenantId();
      long TldId = PKey.getRequiredTldId();

      stmtLockBuffByPKey =
          cnx.prepareCall(
              "begin "
                  + schema.getLowerDbSchemaName()
                  + ".lck_tlddef( ?, ?, ?, ?, ?, ?"
                  + ", "
                  + "?"
                  + ", "
                  + "?"
                  + " ); 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.setLong(argIdx++, TenantId);
      stmtLockBuffByPKey.setLong(argIdx++, TldId);
      stmtLockBuffByPKey.execute();
      resultSet = (ResultSet) stmtLockBuffByPKey.getObject(1);
      if (resultSet == null) {
        return (null);
      }
      try {
        if (resultSet.next()) {
          CFInternetTldBuff buff = unpackTldResultSetToBuff(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;
      }
    }
  }