Filtering collections
AccessionFilter
allows for filtering accession.sources
, but using the .any()
predicate generates an odd database query.
Add a unit test with:
- One accession
- Two
AccessionSource
records:- One with
isOrigin = 'Y'
andsourceTypeCode = COLLECTED
- One with
isOrigin = 'N'
andsourceTypeCode = COLLECTED
- One with
- Assert that filter
{ origin: true, sourceTypeCode: "COLLECTED" }
returns one record
I hope we can avoid using buildJpaQuery
like we do in Genesys.
The fix needs to be applied to all filters where .any()
is used.