Typesafe INSERT

12 views
Skip to first unread message

Michael

unread,
Sep 14, 2011, 10:54:10 AM9/14/11
to jOOQ Developer Group
The declaration of the method set in the interface InsertSetStep
should be
<T> InsertSetMoreStep set(Field<T> field, T value);
to be typesave.

Lukas Eder

unread,
Sep 14, 2011, 11:14:30 AM9/14/11
to jooq...@googlegroups.com, jooq-de...@googlegroups.com
Hello Michael,

Thanks for the hint. That might be a relict from the time when I
wasn't sure about integrating typesafety with respect to the bound of
<T>. The type T is certainly useful when reading data, but in
principle, most RDBMS use implicit casts / conversions when types
don't match. I.e. it's perfectly OK to write things like

SELECT * FROM my_table WHERE '1' = 1

But it is inconsistent with the overall API, so probably you're
right... I have opened ticket
https://sourceforge.net/apps/trac/jooq/ticket/835

Cheers
Lukas

PS: I'm posting this to the user group, too, as this is an
incompatible change that might affect other users, not just jOOQ
developers

2011/9/14 Michael <michae...@googlemail.com>:

Lukas Eder

unread,
Sep 22, 2011, 3:53:01 PM9/22/11
to jooq...@googlegroups.com, jooq-de...@googlegroups.com, michae...@googlemail.com
After some closer inspection, I can see that this is currently
implemented consistently for all SET methods in both DSL and
"standard" API's. An API change at this point is not a good idea, I
have postponed a potential fix to release 2.0

Cheers
Lukas

2011/9/14 Lukas Eder <lukas...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages