7

I am trying to use Spring Data projections with a QueryDsl predicate and when I exceute the query I get a 'java.util.NoSuchElementException'.

I've created the projected interface type and then pass then have the declaration in the repository as follows:

Collection<Mini> findAllProjectedBy(Predicate predicate);

My repository is declared as:

public interface DeviceRepository extends CustomDefaultRepository<PersistableDevice, String>, QueryDslPredicateExecutor<PersistableDevice>, QuerydslBinderCustomizer<QPersistableDevice> {

If I don't use the predicate I have no trouble returning the projection.

aaronc
  • 83
  • 5

0 Answers0