public CFSecuritySecFormBuff lockBuff(
     CFSecurityAuthorization Authorization, CFSecuritySecFormPKey PKey) {
   final String S_ProcName = "lockBuff";
   CFSecuritySecFormBuff buff = readDerived(Authorization, PKey);
   if ((buff != null) && (!buff.getClassCode().equals("SFRM"))) {
     buff = null;
   }
   return (buff);
 }
 public CFSecuritySecFormBuff readBuffByIdIdx(
     CFSecurityAuthorization Authorization, long ClusterId, int SecFormId) {
   final String S_ProcName = "CFInternetRamSecForm.readBuffByIdIdx() ";
   CFSecuritySecFormBuff buff = readDerivedByIdIdx(Authorization, ClusterId, SecFormId);
   if ((buff != null) && buff.getClassCode().equals("SFRM")) {
     return ((CFSecuritySecFormBuff) buff);
   } else {
     return (null);
   }
 }
 public CFSecuritySecFormBuff[] readAllBuff(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "CFInternetRamSecForm.readAllBuff";
   CFSecuritySecFormBuff buff;
   ArrayList<CFSecuritySecFormBuff> filteredList = new ArrayList<CFSecuritySecFormBuff>();
   CFSecuritySecFormBuff[] buffList = readAllDerived(Authorization);
   for (int idx = 0; idx < buffList.length; idx++) {
     buff = buffList[idx];
     if ((buff != null) && buff.getClassCode().equals("SFRM")) {
       filteredList.add(buff);
     }
   }
   return (filteredList.toArray(new CFSecuritySecFormBuff[0]));
 }
 public CFSecuritySecFormBuff[] readBuffBySecAppIdx(
     CFSecurityAuthorization Authorization, long ClusterId, int SecAppId) {
   final String S_ProcName = "CFInternetRamSecForm.readBuffBySecAppIdx() ";
   CFSecuritySecFormBuff buff;
   ArrayList<CFSecuritySecFormBuff> filteredList = new ArrayList<CFSecuritySecFormBuff>();
   CFSecuritySecFormBuff[] buffList = readDerivedBySecAppIdx(Authorization, ClusterId, SecAppId);
   for (int idx = 0; idx < buffList.length; idx++) {
     buff = buffList[idx];
     if ((buff != null) && buff.getClassCode().equals("SFRM")) {
       filteredList.add((CFSecuritySecFormBuff) buff);
     }
   }
   return (filteredList.toArray(new CFSecuritySecFormBuff[0]));
 }
 public void updateSecForm(CFSecurityAuthorization Authorization, CFSecuritySecFormBuff Buff) {
   final String S_ProcName = "updateSecForm";
   if ("SFRM".equals(Buff.getClassCode())
       && (!schema.isClusterUser(Authorization, Buff.getRequiredClusterId(), "UpdateSecForm"))) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(),
             S_ProcName,
             "Permission denied -- User not part of SecGroup UpdateSecForm");
   }
   ResultSet resultSet = null;
   try {
     long ClusterId = Buff.getRequiredClusterId();
     int SecFormId = Buff.getRequiredSecFormId();
     int SecAppId = Buff.getRequiredSecAppId();
     String JEEServletMapName = Buff.getRequiredJEEServletMapName();
     int Revision = Buff.getRequiredRevision();
     Connection cnx = schema.getCnx();
     final String sql =
         "CALL sp_update_secform( ?, ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " )";
     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++, "SFRM");
     stmtUpdateByPKey.setLong(argIdx++, ClusterId);
     stmtUpdateByPKey.setInt(argIdx++, SecFormId);
     stmtUpdateByPKey.setInt(argIdx++, SecAppId);
     stmtUpdateByPKey.setString(argIdx++, JEEServletMapName);
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     resultSet = stmtUpdateByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecuritySecFormBuff updatedBuff = unpackSecFormResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredSecAppId(updatedBuff.getRequiredSecAppId());
       Buff.setRequiredJEEServletMapName(updatedBuff.getRequiredJEEServletMapName());
       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;
     }
   }
 }