Hello,
this topic is atually related to
http://forums.hibernate.org/viewtopic.p ... d568f4e031, but the that thread seems to be overloaded with different issues, so I'm creating a new one...
The [b]contract [/b]for Criteria#setFetchMode(String associationPath, FetchMode mode) is as follows:
Specify an association fetching strategy for an association or a collection of values.
Parameters
* associationPath - a dot seperated property path
* mode - The fetch mode for the referenced association
However, it seems to me that only the "first level" in an association path is really evaluated:
* setFetchMode("orders", FetchMode.SELECT) will work
* setFetchMode("orders.product", FetchMode.SELECT) will have no effect
I've been peeking into the Hibernate Source Code and it seems that CriteriaImpl#getFetchMode is ever only called for the first level in an association path, so that's probably the reason why its not working for paths with more than one level.
Is that assumption corrrect ?
If so, I think there are the following options:
* Update the javadoc comments for Criteria#setFetchMode to match the reality
* Read all fetchmode overrides from CriteriaImpl#fetchModes
Alternatively, are there any workarounds ?
Thanks
Holger