code: public Set<Group> getGroupsFromDB(final JAASSystem _jaasSystem)
          throws EFapsException
      {
          final Set<Group> ret = new HashSet<>();
          Connection con = null;
          try {
              final List<Long> groupIds = new ArrayList<>();
              con = Context.getConnection();
  
              PreparedStatement stmt = null;
              try {
                  if (_jaasSystem == null) {
                      stmt = con.prepareStatement(Person.SQL_GROUP);
                  } else {
                      stmt = con.prepareStatement(Person.SQL_GROUPJAASKEY);
                      stmt.setObject(2, _jaasSystem.getId());
                  }
                  stmt.setObject(1, getId());
                  final ResultSet resultset = stmt.executeQuery();
                  while (resultset.next()) {
                      groupIds.add(resultset.getLong(1));
                  }
                  resultset.close();
              } catch (final SQLException e) {
                  throw new EFapsException(getClass(), "getGroupsFromDB.SQLException", e, getName());
              } finally {
                  try {
                      if (stmt != null) {
                          stmt.close();
                      }
                      con.commit();
                  } catch (final SQLException e) {
                      throw new EFapsException(getClass(), "getGroupsFromDB.SQLException", e, getName());
                  }
              }
              for (final Long groupId : groupIds) {
                  ret.add(Group.get(groupId));
              }
          } finally {
              try {
                  if (con != null && !con.isClosed()) {
                      con.close();
                  }
              } catch (final SQLException e) {
                  throw new CacheReloadException("could not read child type ids", e);
              }
          }
          return ret;
      }
docs: The method reads directly from eFaps all stored groups for the this
  person. The found groups are returned as instance of {@link Set}.
  
  @param _jaasSystem JAAS system for which the groups must fetched from
  eFaps (if value is <code>null</code>, all groups independent
  from the related JAAS system are returned)
  @throws EFapsException on error
  @return set of all found groups for given JAAS system