public void deleteISOCountryLanguage(
      CFSecurityAuthorization Authorization, CFSecurityISOCountryLanguageBuff Buff) {
    final String S_ProcName = "deleteISOCountryLanguage";
    ResultSet resultSet = null;
    try {
      Connection cnx = schema.getCnx();
      short ISOCountryId = Buff.getRequiredISOCountryId();
      short ISOLanguageId = Buff.getRequiredISOLanguageId();

      String sql =
          "call "
              + schema.getLowerDbSchemaName()
              + ".sp_delete_iso_cntrylng( ?, ?, ?, ?, ?"
              + ", "
              + "?"
              + ", "
              + "?"
              + ", "
              + "?"
              + " )";
      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.setShort(argIdx++, ISOCountryId);
      stmtDeleteByPKey.setShort(argIdx++, ISOLanguageId);
      stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision());
      ;
      stmtDeleteByPKey.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 updateISOCountryLanguage(
     CFSecurityAuthorization Authorization, CFSecurityISOCountryLanguageBuff Buff) {
   final String S_ProcName = "updateISOCountryLanguage";
   ResultSet resultSet = null;
   try {
     short ISOCountryId = Buff.getRequiredISOCountryId();
     short ISOLanguageId = Buff.getRequiredISOLanguageId();
     int Revision = Buff.getRequiredRevision();
     Connection cnx = schema.getCnx();
     String sql =
         "call "
             + schema.getLowerDbSchemaName()
             + ".sp_update_iso_cntrylng( ?, ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " )";
     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++, "ISCL");
     stmtUpdateByPKey.setShort(argIdx++, ISOCountryId);
     stmtUpdateByPKey.setShort(argIdx++, ISOLanguageId);
     stmtUpdateByPKey.setInt(argIdx++, Revision);
     try {
       resultSet = stmtUpdateByPKey.executeQuery();
     } catch (SQLException e) {
       if (e.getErrorCode() != 1329) {
         throw e;
       }
       resultSet = null;
     }
     if ((resultSet != null) && resultSet.next()) {
       CFSecurityISOCountryLanguageBuff updatedBuff =
           unpackISOCountryLanguageResultSetToBuff(resultSet);
       if ((resultSet != null) && resultSet.next()) {
         resultSet.last();
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(
                 getClass(),
                 S_ProcName,
                 "Did not expect multi-record response, " + resultSet.getRow() + " rows selected");
       }
       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 CFSecurityISOCountryLanguageBuff unpackISOCountryLanguageResultSetToBuff(
      ResultSet resultSet) throws SQLException {
    final String S_ProcName = "unpackISOCountryLanguageResultSetToBuff";
    int idxcol = 1;
    CFSecurityISOCountryLanguageBuff buff = schema.getFactoryISOCountryLanguage().newBuff();
    {
      String colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setCreatedAt(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setCreatedAt(null);
      } else {
        buff.setCreatedAt(CFCrmMySqlSchema.convertTimestampString(colString));
      }
    }
    idxcol++;
    {
      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++;
    {
      String colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setUpdatedAt(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setUpdatedAt(null);
      } else {
        buff.setUpdatedAt(CFCrmMySqlSchema.convertTimestampString(colString));
      }
    }
    idxcol++;
    {
      String 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++;
    buff.setRequiredISOCountryId(resultSet.getShort(idxcol));
    idxcol++;
    buff.setRequiredISOLanguageId(resultSet.getShort(idxcol));
    idxcol++;

    buff.setRequiredRevision(resultSet.getInt(idxcol));
    return (buff);
  }