System.err.println("QUERY " + q.getQueryString());
  private static List _listVals(Session session, GrouperMember m, String list, String via) {    List groups = new ArrayList();    try {      // Well isn't this an ugly hack...      String via_txt = "";      if (via != null) {        if        ( via.equals("effective") ) {          via_txt = " AND mem.via IS NOT NULL";        } else if ( via.equals("immediate") ) {          via_txt = " AND mem.via IS NULL";        } // TODO else ...      }      // Query away!      Query q = session.createQuery(        "FROM GrouperMembership AS mem"         +        " WHERE "                               +        "mem.memberKey='"     + m.key() + "'"   +        " AND "                                 +        "mem.groupField='"    + list    + "'"   +        via_txt      );         System.err.println("QUERY " + q.getQueryString());      // TODO Behave different depending upon the size?      groups = q.list();    } catch (Exception e) {      System.err.println(e);      System.exit(1);    }    return groups;  }