Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended type mappings are not working. #152

Open
jjspiegel opened this issue Feb 19, 2025 · 0 comments
Open

Extended type mappings are not working. #152

jjspiegel opened this issue Feb 19, 2025 · 0 comments

Comments

@jjspiegel
Copy link
Member

There has been a regression for Jackson -> OSON type mappings after the upgrade to the latest version of Jackson. Conversions from OffsetDateTime to TIMESTAMPTZ are no longer working, for example:

        Movie movie = new Movie("Iron Man", "Action", OffsetDateTime.now());
        
        ObjectMapper mapper = JacksonOsonConverter.getObjectMapper();
        
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        mapper.writeValue(baos, movie);
        baos.close();

        // The Movie represented as OSON binary JSON
        byte[] oson = baos.toByteArray();
        
        OracleJsonFactory f = new OracleJsonFactory();
        OracleJsonObject obj = f.createJsonBinaryValue(ByteBuffer.wrap(oson)).asJsonObject();
        System.out.println(obj.get("created").getOracleJsonType() == OracleJsonType.TIMESTAMPTZ);

Additionally we need unit tests for each type mapping to prevent similar regressions in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant