I have got an object which contains some complicated derived fields, based on values on other tables etc. I am worried about the performance implications of this since the derived queries always appear in the select clause of the sql if I use the criteria api. Is there a way of preventing this, ie only select a limited number of values for a particular class, so that when i do not need to look at the derived fields their queries are not run?
I have tried query by example and using Example.excludeProperty("name") wihout success. This doesnt seem to do what i want it to presumably it just excludes it from restrictions specified by the Example??
If there is not a simple solution using the criteria api, would I be able to do this be implementing a class heirarchy with the derived fields included in the subclass?
|