-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
Automatic generation of result classes #841
Comments
I love this idea. |
Oops, wrong button. I'm imagining that it fits in really nicely -- a type creates a |
Immutables used to have a thing, and I have played with doing a solid one, but the code generation magic in there has been hairy enough that I have not made enough progress. |
I think we'll be solving this one via Immutables integration rather than writing another code generator. Check out #1282 |
I'm calling this one fixed. Use Immutables, it's great :) Let us know if there's any other piece missing here. |
SQL Objects are really nice to use until you need to return a tuple. Then you have to create a custom class and mapper (or use
BeanMapper
and sacrifice immutability).I'm envisioning something where you just write an interface and Jdbi generates the implementation. We'd want automatic mapping from result set names to getters, but allow overrides with annotations. Additionally, we need support for type conversion. For example, how to turn a
varbinary
into aUUID
.I started prototyping this many years ago (predates SQL Objects) but never got very far: https://github.com/electrum/dbmagic
Jackson has a similar idea: https://github.com/FasterXML/jackson-modules-base/tree/master/mrbean
The text was updated successfully, but these errors were encountered: