Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Cache hits for non object queries
Cache hits for non object queries [message #515089] Wed, 17 February 2010 16:54 Go to next message
No real name is currently offline No real nameFriend
Messages: 2
Registered: February 2010
Junior Member
Hello, is it possible to run queries that don't return an object against the cache?

For example a query like this that retrieves the lastnames from all Employees:
SELECT e.lastname FROM Employee e

Assume the table is cached with a full cache and a query was executed before so the cache should be fully populated. When using a ReportQuery i get an exception that report queries can not be used with CheckCacheOnly, when i use a ReadAllQuery the query returns objects instead of only the lastname values.
Re: Cache hits for non object queries [message #515440 is a reply to message #515089] Thu, 18 February 2010 18:57 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1294
Registered: July 2009
Senior Member

No, ReportQuery (which is used for queries returning non-entities) will only hit the database. The reason is likely because the cache is an object cache, and report queries just were over looked as in-memory querying was implemented - it might have just been assumed the entire object would be wanted since it is available. A feature could be filed to get EclipseLink to extract the fields from objects after running the query in-memory, but It might be more efficient to have the application run a query for the entities and then just pull the data from the returned entities directly.

Best Regards,
Previous Topic:[SOLVED] Problem in custom classloader-environment: Object XYZ is not a known entity type
Next Topic:EclipseLink weaving for EMF models
Goto Forum:

Current Time: Wed Apr 25 16:48:34 GMT 2018

Powered by FUDForum. Page generated in 0.01178 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software