On Thursday, June 26, 2014 4:37:41 PM UTC-4, Lukas Eder wrote:
>
>
> I think it's the only reasonable decision, given that even if translating 
> eq(null) / ne(null) seems to be a low-hanging fruit at first, it is 
> completely unexpected and inconsistent with pretty much all of the other 
> API.
>  
>
>> In my case the column is nullable and I ended up creating a wrapper 
>> eqOrIsNull and neOrNotNull to get the behavior I was expecting.
>>
>
> Hmm, yes, that could be useful. Essentially, you're generating A = x OR x 
> IS NULL for A.eq(x)?
>

If value that's passed in is null I return IS NULL, otherwise I return 
eq(val):

 public static <T> Condition eqOrIsNull(Field<T> fld, T val) {

    return val==null ? fld.isNull() : fld.eq(val);

}


Thanks

>

-- 
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/d/optout.

Reply via email to