]
Sanne Grinovero updated ISPN-2826:
----------------------------------
Issue Type: Enhancement (was: Feature Request)
CacheQuery.list() returns List<Object>, which is hard to cast
-------------------------------------------------------------
Key: ISPN-2826
URL:
https://issues.jboss.org/browse/ISPN-2826
Project: Infinispan
Issue Type: Enhancement
Security Level: Public(Everyone can see)
Components: Embedded Querying
Reporter: Ray Tsang
Assignee: Sanne Grinovero
Priority: Minor
Fix For: 7.0.0.Beta1
In example for Books in
https://docs.jboss.org/author/display/ISPN/Querying+Infinispan
~~ snip snip ~~
CacheQuery query = searchManager.getQuery(luceneQuery, Book.class);
// and there are your results!
List<Book> objectList = query.list();
~~ snip snip ~~
This doesn't actually work. CacheQuery.list() returns List<Object>
Thus, you will need to cast: List<Book> books = (List<Book>) cq.list();
But this wouldn't work... Instead you'll end up doing: List<Book> books =
(List<Book>)(List<?>) cq.list();