Hi Ronald,
thanks for the tip. The max_fetch_depth is for outer joins like <many-
to-one> and <one-to-one> only, so my statement seems to keep
right when A has a list of B has a list of C. What of course is not
your point here.
So after reading this chapter of 'NHibernate in Action' it seems clear
to me.
Eager fetching defined in the mapping will only be noticed on Criteria
queries:
>Keep in mind that eager fetching strategies declared in the mapping metadata
>are effective only if you use
>retrieval by identifier, use the criteria query API, or navigate through the
>object graph manually. Any HQL
>query may specify its own fetching strategy at runtime, thus ignoring the
>mapping defaults
If you use HQL you have to add the 'fetch' - Keyword.
It says nothing about fetching with a Dao like getAll(), so i don't
know what is used here.
In a Criteria this should work:
CreateCriteria(typeof(a))
.SetFetchMode("B", FetchMode.Join)
In HQL you could do this:
from A
outer join fetch A.B
where a.something = ....
And this should definitely work. I use it and don't have any problems.
So hopefully this finally helps. If not i guess i can't help you
anymore.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---