]
Gustavo Fernandes updated ISPN-2826:
------------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
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
Fix For: 9.0.0.Beta1, 9.0.0.Final
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();