Hi Zoid,

I think you misunderstood me in my first post.

Let me rephrase my problem, which is basically the same in both
posts:

I have an entity X which has a  relation to an entity Y. This
relationship is configured to be retrieved as a join (non lazy). When
I load a single X by id it will also load the related Y using a join.
The problem starts when I load many X's, for example if I want to load
all X using HQL "from X". If I do this NHibernate does not load the
associated Y's using a join but executes a select to retrieve the X's
and then n-selects to retrieve the Y for each retrieved X.

As to the second part of your answer:

"NHibernate’s outer join fetch behavior is controlled with the global
configuration
option hibernate.max_fetch_depth." (from NHibernate in Action) The
default for this is 1.

Best,
Ronald



On 22 Apr., 00:09, zoid <[email protected]> wrote:
> Hi Ronald,
> i am not sure wheather i got you right, but in your first post you
> wrote that your relation is lazy which means that it is fetched in a
> select by default on the first touch.
> If you want to fetch it with a join try lazy="false".
> Also there exist some limitations on joined fetching in NHibernate.
> Maybe i get blamed for this but as far as i know you can only fetch
> the first and second node joined:
> If A has a Collection of B has a Collection of C you will only get a
> List of A with a collection of B joined. The Collection of c will
> always remain a proxy
> Alternatives or workarrounds are of cause Multiquery and MultiCriteria
> but with a different approach.
>
> Hopefully this helps (if it is at least affecting someone correcting
> my mistakes or backing up my assumptions)
>
> zoid
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to