public List<Group> getGroups(PerunSession sess, Vo vo) throws InternalErrorException { try { return jdbc.query( "select " + groupMappingSelectQuery + " from groups where vo_id=? order by " + Compatibility.orderByBinary("groups.name" + Compatibility.castToVarchar()), GROUP_MAPPER, vo.getId()); } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }
public List<Group> getSubGroups(PerunSession sess, Group parentGroup) throws InternalErrorException { try { return jdbc.query( "select " + groupMappingSelectQuery + " from groups where groups.parent_group_id=? " + "order by " + Compatibility.orderByBinary("groups.name" + Compatibility.castToVarchar()), GROUP_MAPPER, parentGroup.getId()); } catch (EmptyResultDataAccessException e) { return new ArrayList<Group>(); } catch (RuntimeException ex) { throw new InternalErrorException(ex); } }