BasicType registrations for generic JSON types #7179
beikov
started this conversation in
Design Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Add
BasicType
registrations for some generic JSON types:com.fasterxml.jackson.databind.JsonNode
jakarta.json.JsonValue
We would only add these type registrations when the respective JSON library is available on the classpath. The main motivation for this is to allow easy access to JSON data for native queries. People can then use e.g.
NativeQuery.addScalar(..., JsonObject.class)
to retrieve a Json parsed value directly.A possible alternative to this could be that we add
addScalar
overloads that additionally accept aSqlTypes
code, which would allow us to resolve the properJdbcType
and construct the correctBasicType
. This solution would be more flexible and future proof.Related to the discussion is the JPA feature request: jakartaee/persistence#343
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions