} else {
  protected static void save(GrouperSession s, GrouperAttribute attr) {    String            qry   = "GrouperAttribute.by.key.and.value";    List              vals  = new ArrayList();    try {      Query q = s.dbSess().session().getNamedQuery(qry);      q.setString(0, attr.key());      q.setString(1, attr.value());      try {        vals = q.list();        if (vals.size() == 0) {          // We've got a new one: save it.          try {            s.dbSess().session().save(attr);             } catch (HibernateException e) {            throw new RuntimeException(                        "Error saving attribute " + attr + ": " + e                      );          }        } else if (vals.size() == 1) {          // Attribute already exists.  Check to see if the value has          // changed.          GrouperAttribute cur = (GrouperAttribute) vals.get(0);          if (!attr.value().equals(cur.value())) {            try {              s.dbSess().session().update(attr);            } catch (HibernateException e) {              throw new RuntimeException(                          "Error updating attribute " + attr + ": " + e                        );            }          }        }       } catch (HibernateException e) {        throw new RuntimeException(                    "Error retrieving results for " + qry + ": " + e                  );      }    } catch (HibernateException e) {      throw new RuntimeException(                  "Unable to get query " + qry + ": " + e                );    }  }