catch (HibernateException eH) { throw new GroupNotFoundException(ERR_FINDBYTYPE + eH.getMessage(), eH);
catch (QueryException eQ) { throw new GroupNotFoundException(ERR_FINDBYTYPE + eQ.getMessage(), eQ);
  public static Group findByType(GrouperSession s, GroupType type)    throws  GroupNotFoundException,            IllegalArgumentException  {    Validator.argNotNull( s,    "null session" );    Validator.argNotNull( type, "null type"    );    // TODO 20061127 can i use a variant of this query in `GroupType.delete()`?    try {      Session hs  = HibernateHelper.getSession();      Query   qry = hs.createQuery(        "from Group as g where :type in elements(g.group_types)"      );      qry.setCacheable(true);      qry.setCacheRegion(KLASS + ".FindByType");      qry.setParameter("type", type);      Group g = (Group) qry.uniqueResult();      hs.close();      if (g != null) {        g.setSession(s);        if (s.getMember().canView(g)) {          return g;        }      }    }    catch (HibernateException eH) {      throw new GroupNotFoundException(ERR_FINDBYTYPE + eH.getMessage(), eH);    }    throw new GroupNotFoundException(ERR_FINDBYTYPE + U.q( type.toString() ));  } // public static Group findByType(s, type)