Digest for jooq-user@googlegroups.com - 4 updates in 2 topics

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Digest for jooq-user@googlegroups.com - 4 updates in 2 topics

http://groups.google.com/group/jooq-user/topics mailing list
[hidden email]: Nov 07 03:28AM -0800

Hi,
We use JOOQ in my work place. Generated sources _are_ checked in, but need
not be formatted.
 
One way to do this when using an IDE is to use special markers (e.g.
`@formatter:off`/`@formatter:on`)
Since JOOQ sources are generated, what is the best way to go about this?
 
I can always `sed` after the fact, but is it possible to do this as part of
code generation?
 
Regards,
Manoj
Lukas Eder <[hidden email]>: Nov 07 04:06AM -0800

Thank for your enquiry and for illustrating your use-case
 
You could override the JavaGenerator.newJavaWriter() method and return a
JavaWriter that is initialised with @formatter:off. Then override also
JavaWriter.beforeClose() and generate @formatter:on in that method. This
way, you can add these markers to all generated jOOQ classes.
 
Of course, post processing might be easier (e.g. when using Maven to
generate code) and more forwards compatible, so I'd recommend that if
possible.
 
I hope this helps,
Lukas
 
Ernest Mishkin <[hidden email]>: Nov 06 05:33PM -0800

DefaultRecordMapper already supports classes annotated with @java.beans.ConstructorProperties
(ImmutablePOJOMapperWithConstructorProperties) to map record's fields to
constructor parameters by *name*, rather than by *position*. But using the
said annotation is somewhat obsolete approach on modern (1.8+) JVMs where
the information about parameter names can be compiled into byte code using
-parameters argument to javac.
 
I'm really interested in supporting this use case, and wondering if this
may be useful for community at large (happy to contribute a patch in such
case).
If Lukas or one of the other core committers can recommend the best
approach of "hacking" this into DefaultRecordMapper I will appreciate it.
 
Thanks!
Lukas Eder <[hidden email]>: Nov 07 10:50AM +0100

Hi Ernest,
 
Thanks for your suggestion. Indeed, this would be quite useful - we just
haven't gotten around to doing it yet. The relevant feature request is this
one:
https://github.com/jOOQ/jOOQ/issues/4627
 
We'd love to see your contribution! Please see our contribution guidelines
here, and let me know if I can help:
https://github.com/jOOQ/jOOQ/blob/master/CONTRIBUTING.md
 
Thanks,
Lukas
 
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to [hidden email].