protected CFSecuritySecFormBuff unpackSecFormResultSetToBuff(ResultSet resultSet)
      throws SQLException {
    final String S_ProcName = "unpackSecFormResultSetToBuff";
    int idxcol = 1;
    CFSecuritySecFormBuff buff = schema.getFactorySecForm().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(CFAccMSSqlSchema.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(CFAccMSSqlSchema.convertTimestampString(colString));
      }
      idxcol++;
    }
    buff.setRequiredClusterId(resultSet.getLong(idxcol));
    idxcol++;
    buff.setRequiredSecFormId(resultSet.getInt(idxcol));
    idxcol++;
    buff.setRequiredSecAppId(resultSet.getInt(idxcol));
    idxcol++;
    buff.setRequiredJEEServletMapName(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredRevision(resultSet.getInt(idxcol));
    return (buff);
  }
 public void deleteSecAppByUJEEMountIdx(
     CFSecurityAuthorization Authorization, long argClusterId, String argJEEMountName) {
   final String S_ProcName = "deleteSecAppByUJEEMountIdx";
   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_secapp_by_ujeemountidx ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     if (stmtDeleteByUJEEMountIdx == null) {
       stmtDeleteByUJEEMountIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByUJEEMountIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUJEEMountIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByUJEEMountIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByUJEEMountIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUJEEMountIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtDeleteByUJEEMountIdx.setLong(argIdx++, argClusterId);
     stmtDeleteByUJEEMountIdx.setString(argIdx++, argJEEMountName);
     Object stuff = null;
     boolean moreResults = stmtDeleteByUJEEMountIdx.execute();
     while (stuff == null) {
       try {
         moreResults = stmtDeleteByUJEEMountIdx.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           stuff = stmtDeleteByUJEEMountIdx.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtDeleteByUJEEMountIdx.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 CFSecuritySecAppBuff readBuff(
     CFSecurityAuthorization Authorization, CFSecuritySecAppPKey PKey) {
   final String S_ProcName = "readBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     long ClusterId = PKey.getRequiredClusterId();
     int SecAppId = PKey.getRequiredSecAppId();
     String sql = "{ call sp_read_secapp( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ) }";
     if (stmtReadBuffByPKey == null) {
       stmtReadBuffByPKey = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByPKey.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByPKey.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByPKey.setLong(argIdx++, ClusterId);
     stmtReadBuffByPKey.setInt(argIdx++, SecAppId);
     resultSet = stmtReadBuffByPKey.executeQuery();
     if ((resultSet != null) && resultSet.next()) {
       CFSecuritySecAppBuff buff = unpackSecAppResultSetToBuff(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 CFSecurityISOCountryBuff[] 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 = "{ call sp_read_iso_cntry_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<CFSecurityISOCountryBuff> buffList = new LinkedList<CFSecurityISOCountryBuff>();
     if (resultSet != null) {
       while (resultSet.next()) {
         CFSecurityISOCountryBuff buff = unpackISOCountryResultSetToBuff(resultSet);
         buffList.add(buff);
       }
     }
     int idx = 0;
     CFSecurityISOCountryBuff[] retBuff = new CFSecurityISOCountryBuff[buffList.size()];
     Iterator<CFSecurityISOCountryBuff> 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 CFSecurityISOTimezoneBuff[] readDerivedByIso8601Idx(
     CFSecurityAuthorization Authorization, String Iso8601) {
   final String S_ProcName = "readDerivedByIso8601Idx";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFSecurityISOTimezoneBuff[] buffList = readBuffByIso8601Idx(Authorization, Iso8601);
   return (buffList);
 }
 public CFSecurityISOCountryBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllDerived";
   CFSecurityISOCountryBuff[] buffArray;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buffArray = readAllBuff(Authorization);
   return (buffArray);
 }
 public CFSecuritySecAppBuff[] readDerivedByClusterIdx(
     CFSecurityAuthorization Authorization, long ClusterId) {
   final String S_ProcName = "readDerivedByClusterIdx";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFSecuritySecAppBuff[] buffList = readBuffByClusterIdx(Authorization, ClusterId);
   return (buffList);
 }
 public CFSecurityISOCountryBuff readDerivedByNameIdx(
     CFSecurityAuthorization Authorization, String Name) {
   final String S_ProcName = "CFAccMSSqlISOCountryTable.readDerivedByNameIdx() ";
   CFSecurityISOCountryBuff buff;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buff = readBuffByNameIdx(Authorization, Name);
   return (buff);
 }
 public String getSqlSelectISOTimezoneDistinctClassCode() {
   if (S_sqlSelectISOTimezoneDistinctClassCode == null) {
     S_sqlSelectISOTimezoneDistinctClassCode =
         "SELECT "
             + "DISTINCT itzn.ClassCode "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + "..ISOTz AS itzn ";
   }
   return (S_sqlSelectISOTimezoneDistinctClassCode);
 }
 public String getSqlSelectISOCountryDistinctClassCode() {
   if (S_sqlSelectISOCountryDistinctClassCode == null) {
     S_sqlSelectISOCountryDistinctClassCode =
         "SELECT "
             + "DISTINCT isoc.ClassCode "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + "..iso_cntry AS isoc ";
   }
   return (S_sqlSelectISOCountryDistinctClassCode);
 }
 public String getSqlSelectSecAppDistinctClassCode() {
   if (S_sqlSelectSecAppDistinctClassCode == null) {
     S_sqlSelectSecAppDistinctClassCode =
         "SELECT "
             + "DISTINCT sapp.ClassCode "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + "..SecApp AS sapp ";
   }
   return (S_sqlSelectSecAppDistinctClassCode);
 }
 public CFSecurityISOCountryBuff lockDerived(
     CFSecurityAuthorization Authorization, CFSecurityISOCountryPKey PKey) {
   final String S_ProcName = "lockDerived";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFSecurityISOCountryBuff buff;
   buff = lockBuff(Authorization, PKey);
   return (buff);
 }
 public CFSecuritySecAppBuff readDerivedByUJEEMountIdx(
     CFSecurityAuthorization Authorization, long ClusterId, String JEEMountName) {
   final String S_ProcName = "CFAccMSSqlSecAppTable.readDerivedByUJEEMountIdx() ";
   CFSecuritySecAppBuff buff;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buff = readBuffByUJEEMountIdx(Authorization, ClusterId, JEEMountName);
   return (buff);
 }
 public CFSecurityCursor openISOTimezoneCursorByIso8601Idx(
     CFSecurityAuthorization Authorization, String Iso8601) {
   String sql =
       getSqlSelectISOTimezoneBuff()
           + " WHERE "
           + "itzn.iso8601 = "
           + CFAccMSSqlSchema.getQuotedString(Iso8601)
           + " "
           + "ORDER BY "
           + "itzn.ISOTimezoneId ASC";
   CFAccCursor cursor = new CFAccMSSqlCursor(Authorization, schema, sql);
   return (cursor);
 }
 public CFSecurityISOTimezoneBuff[] readBuffByOffsetIdx(
     CFSecurityAuthorization Authorization, short TZHourOffset, short TZMinOffset) {
   final String S_ProcName = "readBuffByOffsetIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "{ call sp_read_isotz_by_offsetidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ) }";
     if (stmtReadBuffByOffsetIdx == null) {
       stmtReadBuffByOffsetIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByOffsetIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByOffsetIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByOffsetIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByOffsetIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByOffsetIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByOffsetIdx.setShort(argIdx++, TZHourOffset);
     stmtReadBuffByOffsetIdx.setShort(argIdx++, TZMinOffset);
     resultSet = stmtReadBuffByOffsetIdx.executeQuery();
     List<CFSecurityISOTimezoneBuff> buffList = new LinkedList<CFSecurityISOTimezoneBuff>();
     if (resultSet != null) {
       while (resultSet.next()) {
         CFSecurityISOTimezoneBuff buff = unpackISOTimezoneResultSetToBuff(resultSet);
         buffList.add(buff);
       }
     }
     int idx = 0;
     CFSecurityISOTimezoneBuff[] retBuff = new CFSecurityISOTimezoneBuff[buffList.size()];
     Iterator<CFSecurityISOTimezoneBuff> 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 String getSqlSelectISOCountryBuff() {
   if (S_sqlSelectISOCountryBuff == null) {
     S_sqlSelectISOCountryBuff =
         "SELECT "
             + "isoc.id, "
             + "isoc.iso_code, "
             + "isoc.country_name, "
             + "isoc.revision "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + "..iso_cntry AS isoc ";
   }
   return (S_sqlSelectISOCountryBuff);
 }
 public String getSqlSelectSecAppBuff() {
   if (S_sqlSelectSecAppBuff == null) {
     S_sqlSelectSecAppBuff =
         "SELECT "
             + "sapp.clusterid, "
             + "sapp.secappid, "
             + "sapp.jeemountname, "
             + "sapp.revision "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + "..SecApp AS sapp ";
   }
   return (S_sqlSelectSecAppBuff);
 }
 public CFSecurityISOCountryBuff readBuffByNameIdx(
     CFSecurityAuthorization Authorization, String Name) {
   final String S_ProcName = "readBuffByNameIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql = "{ call sp_read_iso_cntry_by_nameidx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
     if (stmtReadBuffByNameIdx == null) {
       stmtReadBuffByNameIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByNameIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByNameIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByNameIdx.setString(argIdx++, Name);
     resultSet = stmtReadBuffByNameIdx.executeQuery();
     if ((resultSet != null) && resultSet.next()) {
       CFSecurityISOCountryBuff buff = unpackISOCountryResultSetToBuff(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 String getSqlSelectSecFormBuff() {
   if (S_sqlSelectSecFormBuff == null) {
     S_sqlSelectSecFormBuff =
         "SELECT "
             + "sfrm.clusterid, "
             + "sfrm.secformid, "
             + "sfrm.secappid, "
             + "sfrm.jeeservletmapname, "
             + "sfrm.revision "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + "..SecForm AS sfrm ";
   }
   return (S_sqlSelectSecFormBuff);
 }
  public void deleteSecApp(CFSecurityAuthorization Authorization, CFSecuritySecAppBuff Buff) {
    final String S_ProcName = "deleteSecApp";
    try {
      Connection cnx = schema.getCnx();
      long ClusterId = Buff.getRequiredClusterId();
      int SecAppId = Buff.getRequiredSecAppId();

      String sql = "exec sp_delete_secapp ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?";
      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++, ClusterId);
      stmtDeleteByPKey.setInt(argIdx++, SecAppId);
      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 String getSqlSelectISOTimezoneBuff() {
   if (S_sqlSelectISOTimezoneBuff == null) {
     S_sqlSelectISOTimezoneBuff =
         "SELECT "
             + "itzn.isotimezoneid, "
             + "itzn.iso8601, "
             + "itzn.tzname, "
             + "itzn.tzhouroffset, "
             + "itzn.tzminoffset, "
             + "itzn.description, "
             + "itzn.visible, "
             + "itzn.revision "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + "..ISOTz AS itzn ";
   }
   return (S_sqlSelectISOTimezoneBuff);
 }
 public void updateISOCountry(
     CFSecurityAuthorization Authorization, CFSecurityISOCountryBuff Buff) {
   final String S_ProcName = "updateISOCountry";
   ResultSet resultSet = null;
   try {
     short Id = Buff.getRequiredId();
     String ISOCode = Buff.getRequiredISOCode();
     String Name = Buff.getRequiredName();
     int Revision = Buff.getRequiredRevision();
     Connection cnx = schema.getCnx();
     String sql =
         "exec sp_update_iso_cntry ?, ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?";
     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++, "ISOC");
     stmtUpdateByPKey.setShort(argIdx++, Id);
     stmtUpdateByPKey.setString(argIdx++, ISOCode);
     stmtUpdateByPKey.setString(argIdx++, Name);
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     stmtUpdateByPKey.execute();
     boolean moreResults = true;
     resultSet = null;
     while (resultSet == null) {
       try {
         moreResults = stmtUpdateByPKey.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           resultSet = stmtUpdateByPKey.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtUpdateByPKey.getUpdateCount()) {
         break;
       }
     }
     if (resultSet == null) {
       throw CFLib.getDefaultExceptionFactory()
           .newNullArgumentException(getClass(), S_ProcName, 0, "resultSet");
     }
     if (resultSet.next()) {
       CFSecurityISOCountryBuff updatedBuff = unpackISOCountryResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredISOCode(updatedBuff.getRequiredISOCode());
       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;
     }
   }
 }
  protected CFSecurityISOTimezoneBuff unpackISOTimezoneResultSetToBuff(ResultSet resultSet)
      throws SQLException {
    final String S_ProcName = "unpackISOTimezoneResultSetToBuff";
    int idxcol = 1;
    CFSecurityISOTimezoneBuff buff = schema.getFactoryISOTimezone().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(CFAccMSSqlSchema.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(CFAccMSSqlSchema.convertTimestampString(colString));
      }
      idxcol++;
    }
    buff.setRequiredISOTimezoneId(resultSet.getShort(idxcol));
    idxcol++;
    buff.setRequiredIso8601(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredTZName(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredTZHourOffset(resultSet.getShort(idxcol));
    idxcol++;
    buff.setRequiredTZMinOffset(resultSet.getShort(idxcol));
    idxcol++;
    buff.setRequiredDescription(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredVisible(("Y".equals(resultSet.getString(idxcol)) ? true : false));
    idxcol++;
    buff.setRequiredRevision(resultSet.getInt(idxcol));
    return (buff);
  }
 public CFSecurityISOCountryBuff lockBuff(
     CFSecurityAuthorization Authorization, CFSecurityISOCountryPKey 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();
     short Id = PKey.getRequiredId();
     String sql = "{ call sp_lock_iso_cntry( ?, ?, ?, ?, ?" + ", " + "?" + " ) }";
     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.setShort(argIdx++, Id);
     stmtLockBuffByPKey.execute();
     boolean moreResults = true;
     resultSet = null;
     while (resultSet == null) {
       try {
         moreResults = stmtLockBuffByPKey.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           resultSet = stmtLockBuffByPKey.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtLockBuffByPKey.getUpdateCount()) {
         break;
       }
     }
     if ((resultSet != null) && resultSet.next()) {
       CFSecurityISOCountryBuff buff = unpackISOCountryResultSetToBuff(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 void createISOTimezone(
     CFSecurityAuthorization Authorization, CFSecurityISOTimezoneBuff Buff) {
   final String S_ProcName = "createISOTimezone";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     short ISOTimezoneId = Buff.getRequiredISOTimezoneId();
     String Iso8601 = Buff.getRequiredIso8601();
     String TZName = Buff.getRequiredTZName();
     short TZHourOffset = Buff.getRequiredTZHourOffset();
     short TZMinOffset = Buff.getRequiredTZMinOffset();
     String Description = Buff.getRequiredDescription();
     boolean Visible = Buff.getRequiredVisible();
     Connection cnx = schema.getCnx();
     String sql =
         "exec sp_create_isotz ?, ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?";
     if (stmtCreateByPKey == null) {
       stmtCreateByPKey = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     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++, "ITZN");
     stmtCreateByPKey.setShort(argIdx++, ISOTimezoneId);
     stmtCreateByPKey.setString(argIdx++, Iso8601);
     stmtCreateByPKey.setString(argIdx++, TZName);
     stmtCreateByPKey.setShort(argIdx++, TZHourOffset);
     stmtCreateByPKey.setShort(argIdx++, TZMinOffset);
     stmtCreateByPKey.setString(argIdx++, Description);
     if (Visible) {
       stmtCreateByPKey.setString(argIdx++, "Y");
     } else {
       stmtCreateByPKey.setString(argIdx++, "N");
     }
     stmtCreateByPKey.execute();
     boolean moreResults = true;
     resultSet = null;
     while (resultSet == null) {
       try {
         moreResults = stmtCreateByPKey.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           resultSet = stmtCreateByPKey.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtCreateByPKey.getUpdateCount()) {
         break;
       }
     }
     if (resultSet == null) {
       throw CFLib.getDefaultExceptionFactory()
           .newNullArgumentException(getClass(), S_ProcName, 0, "resultSet");
     }
     if (resultSet.next()) {
       CFSecurityISOTimezoneBuff createdBuff = unpackISOTimezoneResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredISOTimezoneId(createdBuff.getRequiredISOTimezoneId());
       Buff.setRequiredIso8601(createdBuff.getRequiredIso8601());
       Buff.setRequiredTZName(createdBuff.getRequiredTZName());
       Buff.setRequiredTZHourOffset(createdBuff.getRequiredTZHourOffset());
       Buff.setRequiredTZMinOffset(createdBuff.getRequiredTZMinOffset());
       Buff.setRequiredDescription(createdBuff.getRequiredDescription());
       Buff.setRequiredVisible(createdBuff.getRequiredVisible());
       Buff.setRequiredRevision(createdBuff.getRequiredRevision());
       Buff.setCreatedByUserId(createdBuff.getCreatedByUserId());
       Buff.setCreatedAt(createdBuff.getCreatedAt());
       Buff.setUpdatedByUserId(createdBuff.getUpdatedByUserId());
       Buff.setUpdatedAt(createdBuff.getUpdatedAt());
     } 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;
     }
   }
 }
 public void createSecApp(CFSecurityAuthorization Authorization, CFSecuritySecAppBuff Buff) {
   final String S_ProcName = "createSecApp";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     long ClusterId = Buff.getRequiredClusterId();
     String JEEMountName = Buff.getRequiredJEEMountName();
     Connection cnx = schema.getCnx();
     String sql = "exec sp_create_secapp ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     if (stmtCreateByPKey == null) {
       stmtCreateByPKey = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     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++, "SAPP");
     stmtCreateByPKey.setLong(argIdx++, ClusterId);
     stmtCreateByPKey.setString(argIdx++, JEEMountName);
     stmtCreateByPKey.execute();
     boolean moreResults = true;
     resultSet = null;
     while (resultSet == null) {
       try {
         moreResults = stmtCreateByPKey.getMoreResults();
       } catch (SQLException e) {
         throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
       }
       if (moreResults) {
         try {
           resultSet = stmtCreateByPKey.getResultSet();
         } catch (SQLException e) {
         }
       } else if (-1 == stmtCreateByPKey.getUpdateCount()) {
         break;
       }
     }
     if (resultSet == null) {
       throw CFLib.getDefaultExceptionFactory()
           .newNullArgumentException(getClass(), S_ProcName, 0, "resultSet");
     }
     if (resultSet.next()) {
       CFSecuritySecAppBuff createdBuff = unpackSecAppResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredClusterId(createdBuff.getRequiredClusterId());
       Buff.setRequiredSecAppId(createdBuff.getRequiredSecAppId());
       Buff.setRequiredJEEMountName(createdBuff.getRequiredJEEMountName());
       Buff.setRequiredRevision(createdBuff.getRequiredRevision());
       Buff.setCreatedByUserId(createdBuff.getCreatedByUserId());
       Buff.setCreatedAt(createdBuff.getCreatedAt());
       Buff.setUpdatedByUserId(createdBuff.getUpdatedByUserId());
       Buff.setUpdatedAt(createdBuff.getUpdatedAt());
     } 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;
     }
   }
 }