How to apply Fetch Size in queries using Object Mapping?

31 views
Skip to first unread message

Angela Sun

unread,
Apr 27, 2015, 3:59:49 PM4/27/15
to java-dri...@lists.datastax.com
I'm trying to use Accessor annotated interface to do queries, which is part of the Object Mapping API.  Would it be possible to apply something similar to Set Fetch Size in Prepared Statement?

Thanks,
Angela

Olivier Michallat

unread,
May 12, 2015, 4:07:51 AM5/12/15
to java-dri...@lists.datastax.com
Hi Angela,

One thing you can do is have your method return a Statement, on which you can set the fetch size before executing it. However you lose the ability to map your query results, so I agree that the mapper should have better support for this.

This is quite similar to JAVA-540, so I'm adding a comment there to remember to address fetch size.

--

Olivier Michallat

Driver & tools engineer, DataStax


To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Olivier Michallat

unread,
May 12, 2015, 4:17:34 AM5/12/15
to java-dri...@lists.datastax.com
On second thought, JAVA-540 is a bit different because it does not relate to accessors. I've created JAVA-762.

--

Olivier Michallat

Driver & tools engineer, DataStax


Angela Sun

unread,
May 12, 2015, 6:20:42 PM5/12/15
to java-dri...@lists.datastax.com
Thank you!

Angela

Alex Popescu

unread,
May 14, 2015, 12:45:53 AM5/14/15
to java-dri...@lists.datastax.com


On Tuesday, May 12, 2015 at 3:20:42 PM UTC-7, Angela Sun wrote:
Thank you!

Angela




Based on your use case would these options change at runtime or are they set once? 

-- 
Bests,

Alex Popescu | @al3xandru
Sen. Product Manager @ DataStax

Angela Sun

unread,
May 14, 2015, 11:47:47 AM5/14/15
to java-dri...@lists.datastax.com
Hi,

The fetch size would be set once in my application.

Angela

Reply all
Reply to author
Forward
0 new messages