Okay, thanks for the response. I missed the `set(Map)` overload, and I've 
been working jOOQ into a project with older code and haven't being using 
UpdatableRecord yet.  Maybe soon.

I've been using Scala, which I think offers a nice solution to that `set()` 
return type issue -- you can use an "abstract type" in the super-interface, 
and then the sub-interface set()s could return different types.  I'm not 
sure how one could do that with java generics... it doesn't look easy, so 
it makes sense to me that you haven't done it.

Rob

On Thursday, January 30, 2014 1:07:00 AM UTC-5, Lukas Eder wrote:
>
> That appears to be a good idea at first, although there are many subtle 
> differences between the two. These differences might also be the reason why 
> only few databases natively support two INSERT syntaxes. Mostly:
>
> - You can have multi-record INSERTs
> - You can have multi-row UPDATEs
>
> Also, the DSL returns different types on both variants of set methods. A 
> common interface would need to return a common DSL supertype, possibly also 
> giving access to set() and to execute().
>
> I feel that such a trick might lead to a lot of DSL API complexity that is 
> hard to maintain. There are also other clauses that seem to have similar 
> features, like FROM, WHERE.
>
> On the other hand, there are already many ways to execute INSERT or 
> UPDATE. E.g. through UpdatableRecord.store(), or both query types accept 
> Map<Field<?>, ?> as an argument:
>
> http://www.jooq.org/javadoc/3.2.x/org/jooq/UpdateSetStep.html#set(java.util.Map)
>  
>
>
> 2014-01-30 Rob Nikander <[email protected] <javascript:>>
>
>> Hi,
>>
>> It seems this would be useful. Maybe I'm using the library in an odd way, 
>> but I've got insert code that looks a lot like update code -- all the 
>> set(...) calls are the same.  I might put those set(...) calls into a 
>> common function, but you can't because UpdateSetStep is not related to 
>> InsertSetStep.  I've written a wrapper interface that allows be to do 
>> it, but it's not as convenient as it could be.  Have you thought of making 
>> them share a common interface, if that makes sense?
>>
>> Rob
>>
>>     
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to