Skip to content

Commit

Permalink
Merge pull request DSpace#9067 from tdonohue/fix_9066
Browse files Browse the repository at this point in the history
Remove 'cross join' from count query in `update-handle-prefix` script
  • Loading branch information
tdonohue authored Sep 15, 2023
2 parents d97d598 + 14223bd commit 1d4c441
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,11 @@ public List<Handle> findByPrefix(Context context, String prefix) throws SQLExcep

@Override
public long countHandlesByPrefix(Context context, String prefix) throws SQLException {


CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context);
CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class);
CriteriaQuery criteriaQuery = getCriteriaQuery(criteriaBuilder, Handle.class);

Root<Handle> handleRoot = criteriaQuery.from(Handle.class);
criteriaQuery.select(criteriaBuilder.count(criteriaQuery.from(Handle.class)));
criteriaQuery.select(handleRoot);
criteriaQuery.where(criteriaBuilder.like(handleRoot.get(Handle_.handle), prefix + "%"));
return countLong(context, criteriaQuery, criteriaBuilder, handleRoot);
}
Expand Down

0 comments on commit 1d4c441

Please sign in to comment.