hi!
I am having loads and loads of occurrences of something like
((com.test.MyEntity) $1.map.get('com.test.MyEntity')).someProperty ... ((com.test.MyEntity) $1.map.get('com.test.MyEntity')).someOtherProperty .. ((com.test.MyEntity) $1.map.get('com.test.MyEntity')).someMoreProperties
I need to use full qualified names for casting as well as for the map keys because same entity simple names may occur multiple times.
Now I've got two questions:
1) Will odb smart enough to cache the map.get(..) result(s) once to not query the map again and again for each test in my query?
2) Is there anything I could do for shortening the query string? I guess there's no such thing as a "temporary" variable for being used in the query..
I am creating the query using criteriabuilder, then I am converting it to string and replace all occurrences with the proper map.get(..) and (..) casting code.
Alex