public CFSecuritySysClusterBuff lockBuff(
     CFSecurityAuthorization Authorization, CFSecuritySysClusterPKey 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();
     int SingletonId = PKey.getRequiredSingletonId();
     final String sql = "CALL sp_lock_sysclus( ?, ?, ?, ?, ?" + ", " + "?" + " )";
     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.setInt(argIdx++, SingletonId);
     resultSet = stmtLockBuffByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecuritySysClusterBuff buff = unpackSysClusterResultSetToBuff(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 CFSecuritySysClusterBuff[] 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();
     final String sql = "CALL sp_read_sysclus_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<CFSecuritySysClusterBuff> buffList = new LinkedList<CFSecuritySysClusterBuff>();
     while (resultSet.next()) {
       CFSecuritySysClusterBuff buff = unpackSysClusterResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecuritySysClusterBuff[] retBuff = new CFSecuritySysClusterBuff[buffList.size()];
     Iterator<CFSecuritySysClusterBuff> 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 deleteISOLanguageByCode2Idx(
     CFSecurityAuthorization Authorization, String argISO6391Code) {
   final String S_ProcName = "deleteISOLanguageByCode2Idx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql = "CALL sp_delete_iso_lang_by_code2idx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
     if (stmtDeleteByCode2Idx == null) {
       stmtDeleteByCode2Idx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByCode2Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByCode2Idx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByCode2Idx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByCode2Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByCode2Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     if (argISO6391Code != null) {
       stmtDeleteByCode2Idx.setString(argIdx++, argISO6391Code);
     } else {
       stmtDeleteByCode2Idx.setNull(argIdx++, java.sql.Types.VARCHAR);
     }
     resultSet = stmtDeleteByCode2Idx.executeQuery();
     if (resultSet.next()) {
       int deleteFlag = resultSet.getInt(1);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
     } else {
       throw CFLib.getDefaultExceptionFactory()
           .newRuntimeException(
               getClass(),
               S_ProcName,
               "Expected 1 record result set to be returned by delete, not 0 rows");
     }
   } 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 deleteSysCluster(
      CFSecurityAuthorization Authorization, CFSecuritySysClusterBuff Buff) {
    final String S_ProcName = "deleteSysCluster";
    ResultSet resultSet = null;
    try {
      Connection cnx = schema.getCnx();
      int SingletonId = Buff.getRequiredSingletonId();

      final String sql = "CALL sp_delete_sysclus( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )";
      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.setInt(argIdx++, SingletonId);
      stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision());
      ;
      resultSet = stmtDeleteByPKey.executeQuery();
      if (resultSet.next()) {
        int deleteFlag = resultSet.getInt(1);
        if (resultSet.next()) {
          resultSet.last();
          throw CFLib.getDefaultExceptionFactory()
              .newRuntimeException(
                  getClass(),
                  S_ProcName,
                  "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
        }
      } else {
        throw CFLib.getDefaultExceptionFactory()
            .newRuntimeException(
                getClass(),
                S_ProcName,
                "Expected 1 record result set to be returned by delete, not 0 rows");
      }
    } catch (SQLException e) {
      throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
      if (resultSet != null) {
        try {
          resultSet.close();
        } catch (SQLException e) {
        }
        resultSet = null;
      }
    }
  }
 public CFSecuritySysClusterBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllDerived";
   CFSecuritySysClusterBuff[] buffArray;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buffArray = readAllBuff(Authorization);
   return (buffArray);
 }
 public CFSecuritySysClusterBuff[] readDerivedByClusterIdx(
     CFSecurityAuthorization Authorization, long ClusterId) {
   final String S_ProcName = "readDerivedByClusterIdx";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFSecuritySysClusterBuff[] buffList = readBuffByClusterIdx(Authorization, ClusterId);
   return (buffList);
 }
 public CFSecurityISOLanguageBuff[] readDerivedByCode2Idx(
     CFSecurityAuthorization Authorization, String ISO6391Code) {
   final String S_ProcName = "readDerivedByCode2Idx";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFSecurityISOLanguageBuff[] buffList = readBuffByCode2Idx(Authorization, ISO6391Code);
   return (buffList);
 }
 public CFSecurityISOLanguageBuff readDerivedByCode3Idx(
     CFSecurityAuthorization Authorization, String ISO6392Code) {
   final String S_ProcName = "CFAsteriskDb2LUWISOLanguageTable.readDerivedByCode3Idx() ";
   CFSecurityISOLanguageBuff buff;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buff = readBuffByCode3Idx(Authorization, ISO6392Code);
   return (buff);
 }
 public CFSecurityISOLanguageBuff readDerived(
     CFSecurityAuthorization Authorization, CFSecurityISOLanguagePKey PKey) {
   final String S_ProcName = "readDerived";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFSecurityISOLanguageBuff buff;
   buff = readBuff(Authorization, PKey);
   return (buff);
 }
 public String getSqlSelectSysClusterDistinctClassCode() {
   if (S_sqlSelectSysClusterDistinctClassCode == null) {
     S_sqlSelectSysClusterDistinctClassCode =
         "SELECT "
             + "DISTINCT sysc.ClassCode "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + ".sysclus AS sysc ";
   }
   return (S_sqlSelectSysClusterDistinctClassCode);
 }
 public String getSqlSelectISOLanguageDistinctClassCode() {
   if (S_sqlSelectISOLanguageDistinctClassCode == null) {
     S_sqlSelectISOLanguageDistinctClassCode =
         "SELECT "
             + "DISTINCT isln.ClassCode "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + ".iso_lang AS isln ";
   }
   return (S_sqlSelectISOLanguageDistinctClassCode);
 }
 public CFSecuritySysClusterBuff lockDerived(
     CFSecurityAuthorization Authorization, CFSecuritySysClusterPKey PKey) {
   final String S_ProcName = "lockDerived";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   CFSecuritySysClusterBuff buff;
   buff = lockBuff(Authorization, PKey);
   return (buff);
 }
 public CFSecuritySysClusterBuff readDerivedByIdIdx(
     CFSecurityAuthorization Authorization, int SingletonId) {
   final String S_ProcName = "CFAsteriskDb2LUWSysClusterTable.readDerivedByIdIdx() ";
   CFSecuritySysClusterBuff buff;
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   buff = readBuffByIdIdx(Authorization, SingletonId);
   return (buff);
 }
  protected CFSecuritySysClusterBuff unpackSysClusterResultSetToBuff(ResultSet resultSet)
      throws SQLException {
    final String S_ProcName = "unpackSysClusterResultSetToBuff";
    int idxcol = 1;
    CFSecuritySysClusterBuff buff = schema.getFactorySysCluster().newBuff();
    buff.setRequiredSingletonId(resultSet.getInt(idxcol));
    idxcol++;
    buff.setRequiredClusterId(resultSet.getLong(idxcol));
    idxcol++;

    buff.setRequiredRevision(resultSet.getInt(idxcol));
    return (buff);
  }
 public String getSqlSelectSysClusterBuff() {
   if (S_sqlSelectSysClusterBuff == null) {
     S_sqlSelectSysClusterBuff =
         "SELECT "
             + "sysc.sgltn_id, "
             + "sysc.sys_clus_id, "
             + "sysc.Revision "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + ".sysclus AS sysc ";
   }
   return (S_sqlSelectSysClusterBuff);
 }
 public CFSecurityCursor openISOLanguageCursorByCode2Idx(
     CFSecurityAuthorization Authorization, String ISO6391Code) {
   String sql =
       getSqlSelectISOLanguageBuff()
           + "WHERE "
           + ((ISO6391Code == null)
               ? "isln.iso_code2 is null "
               : "isln.iso_code2 = " + CFAsteriskDb2LUWSchema.getQuotedString(ISO6391Code) + " ")
           + "ORDER BY "
           + "isln.ISOLanguageId ASC";
   CFAsteriskCursor cursor = new CFAsteriskDb2LUWCursor(Authorization, schema, sql);
   return (cursor);
 }
 public CFSecurityISOLanguageBuff[] readBuffByCode2Idx(
     CFSecurityAuthorization Authorization, String ISO6391Code) {
   final String S_ProcName = "readBuffByCode2Idx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql = "CALL sp_read_iso_lang_by_code2idx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
     if (stmtReadBuffByCode2Idx == null) {
       stmtReadBuffByCode2Idx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByCode2Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByCode2Idx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByCode2Idx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByCode2Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByCode2Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     if (ISO6391Code != null) {
       stmtReadBuffByCode2Idx.setString(argIdx++, ISO6391Code);
     } else {
       stmtReadBuffByCode2Idx.setNull(argIdx++, java.sql.Types.VARCHAR);
     }
     resultSet = stmtReadBuffByCode2Idx.executeQuery();
     List<CFSecurityISOLanguageBuff> buffList = new LinkedList<CFSecurityISOLanguageBuff>();
     while (resultSet.next()) {
       CFSecurityISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecurityISOLanguageBuff[] retBuff = new CFSecurityISOLanguageBuff[buffList.size()];
     Iterator<CFSecurityISOLanguageBuff> 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 CFSecurityISOLanguageBuff readBuffByCode3Idx(
     CFSecurityAuthorization Authorization, String ISO6392Code) {
   final String S_ProcName = "readBuffByCode3Idx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql = "CALL sp_read_iso_lang_by_code3idx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
     if (stmtReadBuffByCode3Idx == null) {
       stmtReadBuffByCode3Idx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByCode3Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByCode3Idx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByCode3Idx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByCode3Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByCode3Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByCode3Idx.setString(argIdx++, ISO6392Code);
     resultSet = stmtReadBuffByCode3Idx.executeQuery();
     if (resultSet.next()) {
       CFSecurityISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(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 getSqlSelectISOLanguageBuff() {
   if (S_sqlSelectISOLanguageBuff == null) {
     S_sqlSelectISOLanguageBuff =
         "SELECT "
             + "isln.ISOLanguageId, "
             + "isln.iso_code3, "
             + "isln.iso_code2, "
             + "isln.eng_name, "
             + "isln.Revision "
             + "FROM "
             + schema.getLowerDbSchemaName()
             + ".iso_lang AS isln ";
   }
   return (S_sqlSelectISOLanguageBuff);
 }
 public void updateSysCluster(
     CFSecurityAuthorization Authorization, CFSecuritySysClusterBuff Buff) {
   final String S_ProcName = "updateSysCluster";
   if ("SYSC".equals(Buff.getClassCode()) && (!schema.isSystemUser(Authorization))) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(),
             S_ProcName,
             "Permission denied -- only system user can modify SysCluster data");
   }
   ResultSet resultSet = null;
   try {
     int SingletonId = Buff.getRequiredSingletonId();
     long ClusterId = Buff.getRequiredClusterId();
     int Revision = Buff.getRequiredRevision();
     Connection cnx = schema.getCnx();
     final String sql =
         "CALL sp_update_sysclus( ?, ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + ", " + "?" + " )";
     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++, "SYSC");
     stmtUpdateByPKey.setInt(argIdx++, SingletonId);
     stmtUpdateByPKey.setLong(argIdx++, ClusterId);
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     resultSet = stmtUpdateByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecuritySysClusterBuff updatedBuff = unpackSysClusterResultSetToBuff(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(updatedBuff.getRequiredClusterId());
       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 CFSecurityISOLanguageBuff unpackISOLanguageResultSetToBuff(ResultSet resultSet)
      throws SQLException {
    final String S_ProcName = "unpackISOLanguageResultSetToBuff";
    int idxcol = 1;
    CFSecurityISOLanguageBuff buff = schema.getFactoryISOLanguage().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(CFAsteriskDb2LUWSchema.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(CFAsteriskDb2LUWSchema.convertTimestampString(colString));
      }
      idxcol++;
    }
    buff.setRequiredISOLanguageId(resultSet.getShort(idxcol));
    idxcol++;
    buff.setRequiredISO6392Code(resultSet.getString(idxcol));
    idxcol++;
    {
      String colVal = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setOptionalISO6391Code(null);
      } else {
        buff.setOptionalISO6391Code(colVal);
      }
    }
    idxcol++;
    buff.setRequiredEnglishName(resultSet.getString(idxcol));
    idxcol++;

    buff.setRequiredRevision(resultSet.getInt(idxcol));
    return (buff);
  }
 public void updateISOLanguage(
     CFSecurityAuthorization Authorization, CFSecurityISOLanguageBuff Buff) {
   final String S_ProcName = "updateISOLanguage";
   if ("ISLN".equals(Buff.getClassCode()) && (!schema.isSystemUser(Authorization))) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(),
             S_ProcName,
             "Permission denied -- only system user can modify ISOLanguage data");
   }
   ResultSet resultSet = null;
   try {
     short ISOLanguageId = Buff.getRequiredISOLanguageId();
     String ISO6392Code = Buff.getRequiredISO6392Code();
     String ISO6391Code = Buff.getOptionalISO6391Code();
     String EnglishName = Buff.getRequiredEnglishName();
     int Revision = Buff.getRequiredRevision();
     Connection cnx = schema.getCnx();
     final String sql =
         "CALL sp_update_iso_lang( ?, ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " )";
     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++, "ISLN");
     stmtUpdateByPKey.setShort(argIdx++, ISOLanguageId);
     stmtUpdateByPKey.setString(argIdx++, ISO6392Code);
     if (ISO6391Code != null) {
       stmtUpdateByPKey.setString(argIdx++, ISO6391Code);
     } else {
       stmtUpdateByPKey.setNull(argIdx++, java.sql.Types.VARCHAR);
     }
     stmtUpdateByPKey.setString(argIdx++, EnglishName);
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     resultSet = stmtUpdateByPKey.executeQuery();
     if (resultSet.next()) {
       CFSecurityISOLanguageBuff updatedBuff = unpackISOLanguageResultSetToBuff(resultSet);
       if (resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       Buff.setRequiredISO6392Code(updatedBuff.getRequiredISO6392Code());
       Buff.setOptionalISO6391Code(updatedBuff.getOptionalISO6391Code());
       Buff.setRequiredEnglishName(updatedBuff.getRequiredEnglishName());
       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;
     }
   }
 }