code: public void deleteUser (final User user)
          throws PersistenceException
      {
          if (user.isDeleted()) {
              return;
          }
  
          executeUpdate(new Operation<Object>() {
              public Object invoke (Connection conn, DatabaseLiaison liaison)
                  throws PersistenceException, SQLException
              {
                 // create our modified fields mask
                  FieldMask mask = _utable.getFieldMask();
                  mask.setModified("username");
                  mask.setModified("password");
                  mask.setModified("email");
  
                  // set the password to unusable
                  user.password = "";
  
                  // 'disable' their email address
                  String newEmail = user.email.replace('@','#');
                  user.email = newEmail;
  
                  String oldName = user.username;
                  for (int ii = 0; ii < 100; ii++) {
                      try {
                          user.username = StringUtil.truncate(ii + "=" + oldName, 24);
                          _utable.update(conn, user, mask);
                          return null; // nothing to return
                      } catch (SQLException se) {
                          if (!liaison.isDuplicateRowException(se)) {
                              throw se;
                          }
                      }
                  }
  
                  // ok we failed to rename the user, lets bust an error
                  throw new PersistenceException("Failed to 'delete' the user");
              }
          });
      }
docs: 'Delete' the users account such that they can no longer access it, however we do not delete
  the record from the db.  The name is changed such that the original name has XX=FOO if the
  name were FOO originally.  If we have to lop off any of the name to get our prefix to fit we
  use a minus sign instead of a equals side.  The password field is set to be the empty string
  so that no one can log in (since nothing hashes to the empty string.  We also make sure
  their email address no longer works, so in case we don't ignore 'deleted' users when we do
  the sql to get emailaddresses for the mass mailings we still won't spam delete folk.  We
  leave the emailaddress intact exect for the @ sign which gets turned to a #, so that we can
  see what their email was incase it was an accidently deletion and we have to verify through
  email.