OMG, Yes of course !

I'm to tired, I need holidays (in just few hours...  ;-) ).

Congratulation for Jooq.

Thank you.
Ronan.

Le vendredi 22 juillet 2016 08:51:21 UTC+2, Lukas Eder a écrit :
>
> Hi Ronan,
>
> Ah, the blessings of Java generics and wildcards.
>
> The short version is: You cannot add anything (other than the null 
> literal) to a List<?> or List<? extends Anything>. What you want is a 
> List<Field<?>> or something similar, instead:
>
> Collection<SelectField<?>> l1 = Arrays.asList(TR.ID, TR.BARCODE);
> Collection<SelectField<?>> l2 = Arrays.asList(TR.CUSTOMER_PAYMENT, 
> TR.CREATED_AT));
> Collection<SelectField<?>> c = new ArrayList<>();
>
> c.addAll(l1); // Works now
> c.addAll(l2); // Works now
>
> The long version is explained on Stack Overflow, for instance:
> http://stackoverflow.com/q/2776975/521799
>
> Hope this helps,
> Lukas
>
> 2016-07-21 18:41 GMT+02:00 Ronan Michaux <[email protected] 
> <javascript:>>:
>
>> Hello,
>>
>>
>> I want to create a dynamic list of columns for a *dsl.select(...)*.
>>
>>
>>
>> Collection<? extends SelectField<?>> l1 = Arrays.asList(TR.ID, TR.BARCODE);
>>
>> Collection<? extends SelectField<?>> l2 = Arrays.asList(TR.CUSTOMER_PAYMENT, 
>> TR.CREATED_AT));
>>
>> Collection<? extends SelectField<?>> c = new ArrayList<>();
>>
>> c.addAll(l1); // COMPILE ERROR !!
>> c.addAll(l2); // COMPILE ERROR !!
>>
>>
>>
>> // dsl.select(c);
>>
>>
>>
>>
>> *The compile error is :*
>>
>>
>> incompatible types: java.util.Collection<capture#1 of ? extends 
>> org.jooq.SelectField<?>> cannot be converted to java.util.Collection<? 
>> extends capture#2 of ? extends org.jooq.SelectField<?>>
>>
>>
>> *What is the correct typing ?*
>>
>>
>> Regards,
>> Ronan.
>>
>> -- 
>> 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/d/optout.
>>
>
>

-- 
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