`SessionImpl.determineCacheRetrieveMode(Map<String, Object> settings)` expects that values for `javax.persistence.cache.retrieveMode` are ENUMS. So, it is impossible to use these hints in `@QueryHint` because value in `QueryHint` can be only of type `String`.
I'm a bit unsure if this issue has resurfaced (see https://hibernate.atlassian.net/browse/HHH-8949), if it's a spring-data related or a hibernate bug.
An inspiring bug reporting! As you can see from the Javadoc of javax.persistence.QueryHint as below, it is mainly used for NamedQuery or NamedNativeQuery, so I guess either Spring Data JPA or your code misuses it to pass generic hints?