[infinispan-dev] changing the CacheQuery.list() method to retrieve a typed list.

Galder Zamarreño galder at redhat.com
Mon Feb 25 07:29:57 EST 2013


Could something like JSR-107's unwrap method help here?

See: https://github.com/jsr107/jsr107spec/blob/master/src/main/java/javax/cache/Cache.java#L506

Cheers,

On Feb 18, 2013, at 4:01 PM, Xavier Coulon <xcoulon at redhat.com> wrote:

> Hello,
> 
> [This mail summaries a conversation that I started with Sanne and Emmanuel, off-list]
> 
> The current CacheQuery.list() method returns a List<Object>, which less handy to manipulate than a typed list (List<Book> for example).
> 
> My initial question is: could the CacheQuery.list() method be changed into something like CacheQuery.list(Book.class) which would return a List<Book> ?
> 
> After discussing this subject with Sanne and Emmanuel, it seems to be interesting but not so trivial, partially because of the way Infinispan supports Projections. 
> Which brings me to the suggestion where, in case of projections, the result list could be a List<Book> for which only of subset of the attributes would be set. 
> 
> While another user opened a similar issue last week -nice coincidence- : https://issues.jboss.org/browse/ISPN-2826,  Sanne pointed me to https://issues.jboss.org/browse/ISPN-949 which is about using something similar to ResultTransformers in Infinispan. 
> 
> 
> Thanks,
> Best regards,
> /Xavier
> 
> 
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


--
Galder Zamarreño
galder at redhat.com
twitter.com/galderz

Project Lead, Escalante
http://escalante.io

Engineer, Infinispan
http://infinispan.org




More information about the infinispan-dev mailing list