aspose file tools
The moose likes Object Relational Mapping and the fly likes eager fetching of lazy formulas via criteria api Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "eager fetching of lazy formulas via criteria api" Watch "eager fetching of lazy formulas via criteria api" New topic
Author

eager fetching of lazy formulas via criteria api

Alexey Zhukov
Greenhorn

Joined: Jun 02, 2011
Posts: 1
I have simple entity with lazy @Formula property:


I made instrumentation for this class and it works fine.
Sample code for testing:


Unfortunately, the method ((TestEntity)o).getCustom() invokes an additional select-statement for fetching formula:


When i use this code:


I receive only one select-query execution, but result is List of Object[]. This is not useful.
How can i get List of TestEntities with eagerly fetched custom fields?

PS. Sorry for my English.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: eager fetching of lazy formulas via criteria api
 
Similar Threads
Problem with Hibernate Criteria, Projections and associations
Hibernate - Conditions are not applied in Inner Criteria Query
Question in Hibernate Criteria Query
Hibernate Criteria Query not working properly
Hibernate doing a JOIN and a SELECT though only a JOIN is specified as FetchType and on the hbm