[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] cache report queries
|
The "cache-usage" is for the object cache, what you want is to use the query
cache.
See,
http://www.eclipse.org/eclipselink/api/1.1.1/org/eclipse/persistence/config/QueryHints.html#QUERY_RESULTS_CACHE
It is odd that you can a User back though. Probably log a bug for that, you
should probably get an exception that states CheckCacheThenDatabase is an
invalid option for a ReportQuery.
Jan Kriesten-2 wrote:
>
>
> Hi,
>
> is there a way to also cache report queries? E.g. I have something like
> this:
>
> Query q = entityManager.createQuery( "select count(e) from User e" )
> Long result = (Long) q.getSingleResult()
>
> If I add a cache hint to the query
>
> q.setHint( "eclipselink.cache-usage", "CheckCacheThenDatabase" )
>
> I get a class cast exception (User -> Long), which is a bit puzzling.
>
> Best regards, --- Jan.
>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://www.nabble.com/cache-report-queries-tp24588278p24700380.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.