QueryHint annotation - Missing support for CacheRetrieveMode

Description

`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.

Reproducer:
https://github.com/NicklasWallgren/HHH-8949-spring-data-issue
`./gradlew test`

Environment

None

Activity

Show:
Nathan Xu
September 21, 2020, 1:56 PM
Edited

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?

Assignee

Nathan Xu

Reporter

Nicklas Wallgren

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Minor
Configure