Skip to content

Commit

Permalink
Try to avoid select distinct because it fails in Oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
ato committed Jul 21, 2024
1 parent 468b980 commit 9f39a35
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions common/src/pandas/collection/CollectionRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@
public interface CollectionRepository extends CrudRepository<Collection, Long> {
List<Collection> findByParentIsNullAndSubjectsIsEmpty();

@Query("select distinct c from Collection c join c.subjects s where s in (:subjects) order by c.name")
@Query("SELECT c FROM Collection c WHERE EXISTS (SELECT 1 FROM c.subjects s WHERE s IN :subjects)")
List<Collection> findByAnyOfSubjects(@Param("subjects") List<Subject> subject);

@Query("select distinct c from Collection c join c.subjects s where s.id in (:subjects) order by c.name")
List<Collection> findByAnyOfSubjectIds(@Param("subjects") List<Long> subjectIds);

@Query("select c from Collection c\n" +
"where upper(c.name) like :pattern\n" +
"and c.isDisplayed = true\n" +
Expand Down

0 comments on commit 9f39a35

Please sign in to comment.