mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Bug fix. Only use pageSize and offset if >0
(cherry picked from commit 15de2d0074
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
8aad365496
commit
8b748af944
@@ -112,7 +112,8 @@ public class EPersonDAOImpl extends AbstractHibernateDSODAO<EPerson> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EPerson> findByGroups(Context context, Set<Group> groups, int pageSize, int offset) throws SQLException {
|
||||
public List<EPerson> findByGroups(Context context, Set<Group> groups, int pageSize, int offset)
|
||||
throws SQLException {
|
||||
Query query = createQuery(context,
|
||||
"SELECT DISTINCT e FROM EPerson e " +
|
||||
"JOIN e.groups g " +
|
||||
@@ -122,10 +123,16 @@ public class EPersonDAOImpl extends AbstractHibernateDSODAO<EPerson> implements
|
||||
for (Group group : groups) {
|
||||
idList.add(group.getID());
|
||||
}
|
||||
|
||||
query.setParameter("idList", idList);
|
||||
|
||||
return list(query, pageSize, offset);
|
||||
if (pageSize > 0) {
|
||||
query.setMaxResults(pageSize);
|
||||
}
|
||||
if (offset > 0) {
|
||||
query.setFirstResult(offset);
|
||||
}
|
||||
|
||||
return list(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user