This reverts commit cd6c7cd6c9. The fix in Spring Data JPA is incomplete so we need to reinstate the workaround.
cd6c7cd6c9