rzo1 opened a new pull request, #174:
URL: https://github.com/apache/openjpa/pull/174
`convertToKernelValue()` returned a String value for `cache.retrieveMode`
and `cache.storeMode` untouched. Since this PR the bean property for those keys
resolves to the new JPA 3.2 setters on `EntityManagerImpl`, which take the
jakarta enums, so `em.setProperty("jakarta.persistence.cache.retrieveMode",
"USE")` reached `Method.invoke` with a String and died with an argument type
mismatch. The same applies to the map passed to `createEntityManager()`, so
this affects ordinary configuration, not only the new API.
The conversion is now driven by the target type rather than by the key: a
value already of the target type passes through, a String is parsed into the
target enum, and an enum of a different type is mapped by constant name — which
is what lets a jakarta `CacheStoreMode` reach a kernel `DataCacheStoreMode`. An
unusable String now fails with a message naming the property and its legal
values. The early return this replaces cannot simply be dropped: it was added
together with those setters and is what keeps the enum-valued form working.
Being type-driven, it also fixes
`jakarta.persistence.lock.scope="EXTENDED"`, which failed in `StringUtil.parse`
with "Unsupported type".
A null mode now resets the fetch plan to its default rather than meaning
BYPASS, so clearing one of these properties does not leave the plan bypassing
the cache; both setters document that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]