Thanks Lukas for your quick action. Looking forward to using it.

Regards,
Gaurav


On Tue, Apr 8, 2014 at 5:49 AM, Lukas Eder <[email protected]> wrote:

> This is now implemented on GitHub master, ready for inclusion in jOOQ 3.4
>
> Cheers
> Lukas
>
>
> 2014-04-05 11:26 GMT+02:00 Lukas Eder <[email protected]>:
>
> Hello,
>>
>> Thanks for your suggestion. I have registered #3169 for this:
>> https://github.com/jOOQ/jOOQ/issues/3169
>>
>> 2014-04-03 22:25 GMT+02:00 gaurav gehlot <[email protected]>:
>>
>> Hi,
>>>
>>> The ResultQuery class has various fetch methods. There is fetchOne which
>>> has the following two variants in addition to many other -
>>>
>>> R fetchOne();
>>> <E> E fetchOneInto(Class<? extends E> type);
>>>
>>> The equivalent fetchAny method is,
>>>
>>> R fetchAny();
>>>
>>> But for some cases, I find that it would be helpful if there was the
>>> following method as well,
>>>
>>> <E> E fetchAnyInto(Class<? extends E> type);
>>>
>>> Mainly for the cases where there can be multiple records returned by a
>>> query and you are interested only in the first one.
>>>
>>> I was just curious regarding why this is not present
>>>
>>
>> No particular reason.
>>
>>
>>>  and if there is a workaround. Will be good to know.
>>>
>>
>> Yes, the workaround is to assign the record, null-check it and in the
>> event of it being non-null, call Record.into() on it:
>>
>> R record = query.fetchAny();
>> if (record != null)
>>     E pojo = record.into(type);
>>
>>
>> ... which is in fact what will be implemented in
>> ResultQuery.fetchAnyInto(Class), for jOOQ 3.4
>>
>
>  --
> 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.
>

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