Thanks for responding so promptly!
I'm glad an actual Hibernate Team Member responded, and I'm glad to hear that it was a design decision. I'd like to humbly challenge it, and I'd appreciate your feedback again.
I try to define little in the HBMs as well, but in some cases, such as when I know that I
always want to load a particular many-to-one association, I appreciate that I can configure the mapping to do so. But it kills me to have to specify joins, fetching, and aliases in every HQL query.
I agree that there's great flexibility in being able to specify eager fetching in HQL, and it's also great that HQL queries don't have to honor the mapping.
However, I'd say that the design decision to
always ignore the mapping's outer-join settings doesn't allow flexibility, but limits it.
Wouldn't it be more flexible to allow the developer to choose whether HQL honors outer-join settings?
Certainly it would be a pain to modify HQL so that the developer can specify expressions that say "
don't outer join to this", plus it would just be ugly.
However, what about one or more of the following:
- Allow the developer to specify whether an IQuery should honor the mapping's outer-joins?
- Or allow it as an option on the Configuration? (Personally, I would always leave it on).
It seems to me that would provide
more flexibility while reducing confusion and extra code. Useful enough to submit to JIRA?
One more question...
If I wanted to try making this enhancement to the HQL engine myself, do you have any thoughts on how difficult it would be?
Thanks!