]
Adrian Nistor reassigned ISPN-2826:
-----------------------------------
Assignee: Adrian Nistor
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
Components: Embedded Querying
Reporter: Ray Tsang
Assignee: Adrian Nistor
Priority: Minor
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();