Hi,
It is possible to query data into maps or custom value objects with use of HQL, to return only subset of information rather than to load whole entity(ies).
I wonder, if I use 'select new map(..)' - does it really slower than 'select new SomeValueObject(...)' ? With use of maps I have flexibility in returing dynamic number of fields, while with custom value object, i will be limited with properties defined there and for every new subset of them i will need to create correspondent constructure with parameters.
Did anyway profile both types of queries ?
|