Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
fetch="join" works, but FetchMode.Eager doesn't?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Luke Bakken  
View profile  
 More options Apr 6 2009, 12:12 pm
From: Luke Bakken <luke.bak...@gmail.com>
Date: Mon, 6 Apr 2009 09:12:25 -0700
Local: Mon, Apr 6 2009 12:12 pm
Subject: fetch="join" works, but FetchMode.Eager doesn't?
Hi everyone,

I'm sure I'm just doing something a little wrong, but I wanted to
eager-load the objects represented by these lines in my hbm:

<many-to-one name="CreatedBy" class="User"  column="CreatedByUserUID"
access="field.camelcase-underscore" cascade="none" not-null="true"
foreign-key="FK_Users_WorkflowItems_CreatedBy" fetch="join" />

<many-to-one name="OwnedBy"   class="User"  column="OwnedByUserUID"
access="field.camelcase-underscore" cascade="none" not-null="true"
foreign-key="FK_Users_WorkflowItems_OwnedBy" fetch="join" />

At first I tried using "FetchMode.Eager" in my DAO for retrieving the
class (WorkflowItem) that contains the above associations:

ICriteria crit = NHibernateSession.CreateCriteria(typeof(WorkflowItem), "wf");
crit.SetFetchMode("wf.CreatedBy", FetchMode.Eager);
crit.SetFetchMode("wf.OwnedBy", FetchMode.Eager);

But the above code did not produce the expected joins in the output
SQL. Adding 'fetch="join"' in the hbm works like a charm.

Any ideas?
Thanks,
Luke


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »