Skip to content

Add option to register custom class serializers #2291

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

Open
mikeyg123 opened this issue Apr 8, 2025 · 0 comments
Open

Add option to register custom class serializers #2291

mikeyg123 opened this issue Apr 8, 2025 · 0 comments

Comments

@mikeyg123
Copy link

mikeyg123 commented Apr 8, 2025

Use case

Want to insert data structured as List<Map<String, Object>> without having to covert every row to a dto object and provide getters.
This kind of structure typically comes from query resultset, csv parser, apache camel exchange etc. The map is of column name to value.

Describe the solution you'd like

Be able to register a class serializer for Map with POJOSerializers which calls Map.get("column") with the appropriate cast.
Alternatively add built in serializer option that handles List<Map<String, ?>> type
Or possibly have the register method detect get(column-name) methods as valid serialization methods

also allow java record getter methods (which don't start with "get") to act as serialization methods

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

No branches or pull requests

2 participants