kundera icon indicating copy to clipboard operation
kundera copied to clipboard

Query on class with composite ID returns all items regardless of maxResults setting

Open robgratz opened this issue 13 years ago • 3 comments

I have a class that has and ID composed of three values. I am able to do all operations (ie. read/write/query/delete/etc.) but when I tried to limit the number of returned items by specifying the maxResults field in the query, the value is ignored and all results are returned. This makes the library unusable for us because there is no way to page through results and the strategy of having a starting record as part of the query (ie. all values > some value) doesn't work because you can't limit the number of returned records. In looking at the CassQuery class, I noticed that the maxResults field is used in one of the paths within populateEntities(). Is there a technical reason why the other paths can't use the maxResults field? Thanks in advance.

robgratz avatar Mar 04 '13 22:03 robgratz

setMaxResults() should work to limit on number of records. I will have a look.

Work over pagination over Cassandra from all modes(composite, native, via thrift) is in progress and probably will be released in 2.5

-Vivek

mevivs avatar Mar 05 '13 02:03 mevivs

Fixed. Please refer junit: https://github.com/impetus-opensource/Kundera/blob/trunk/kundera-cassandra/src/test/java/com/impetus/client/crud/compositeType/CassandraCompositeTypeTest.java

Method onLimit() for reference.

Pagination will be supported by Kundera 2.5

-Vivek

mevivs avatar Mar 05 '13 12:03 mevivs

Pagination is supported over Cassandra/HBase. It should be fine now.

-Vivek

mevivs avatar Jul 11 '13 07:07 mevivs