Digest for jooq-user@googlegroups.com - 5 updates in 3 topics

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

Digest for jooq-user@googlegroups.com - 5 updates in 3 topics

http://groups.google.com/group/jooq-user/topics mailing list
"St├ęphane Kahn" <[hidden email]>: Dec 07 11:34AM -0800

Hi,
 
I think I found a bug in jOOQ generator: previously (3.8.1) it managed to
create classes for function with same names but different arguments/return,
e.g.: myfunction() and myfunction(INTEGER).
It used to generate two classes (Myfunction1.java and Myfunction2.java and
corresponding records) and everything was fine.
 
I wanted to upgrade to 3.10.2, but the generator doesn't work anymore in
such case. It creates one class (Myfunction.java) with duplicated fields. I
tried with 3.9.1, I get the same result.
 
Before I realised it is related to functions with same name, I created a
post on StackOverflow with (slightly) more details:
 
https://stackoverflow.com/questions/47698834/jooq-generator-error-variable-already-defined-when-two-functions-have-same-nam
 
Thank you,
St├ęphane
Lukas Eder <[hidden email]>: Dec 07 09:26AM +0100

Hi Stan,
 
Thanks for your message. The easiest way forward in these cases is to use
the code generator that is built into jOOQ. It will generate those
VARCHAR.asEnumDataType() mappings for you, so you will never need to
remember them.
 
If you cannot or do not want to use the code generator, then you will need
to do the exact same thing as the code generator would have done, manually.
Your usage of the API is correct, you somehow have to tell the jOOQ runtime
API that what appears to be a VARCHAR type is really an enum type, in case
of which jOOQ will be able to generate the necessary cast for you.
 
I hope this helps,
Lukas
 
Stan Svec <[hidden email]>: Dec 07 08:56AM -0800

Hi Lukas,
 
Good to know I'm doing it correctly. Thanks for the confirmation and also
for this great product!
 
Best,
 
Stan
Lukas Eder <[hidden email]>: Dec 07 11:01AM +0100

Hi Manuel,
 
Thank you very much for the clarification. I can confirm the problem now.
Indeed, the foreign keys are lacking their name. This can also be
reproduced as follows:
 
for (Table<?> t : ctx.meta().getTables())
for (ForeignKey<?, ?> r : t.getReferences())
System.out.println(r);
 
So, this issue isn't strictly related to the DSLContext.ddl() export, but
to any usage of org.jooq.Meta. I've created and already fixed an issue for
this:
https://github.com/jOOQ/jOOQ/issues/6887
 
The fix will be merged to 3.10.3 and 3.9.7. If you want to patch your
version before any new release, the fix was really simple:
https://github.com/jOOQ/jOOQ/commit/895a23ea93f3961f34c6cac5c5b495fd7db6d26d
 
Thanks again for reporting this,
Lukas
 
 
 
Manuel Rossetti <[hidden email]>: Dec 07 08:38AM -0600

Super. Glad that I could help.
 
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].