If you know that you're going to iterate over the Areas then I'd suggest
eagerly loading them - what's your reasoning for not wanting to do that?

 

/Pete

 

From: [email protected] [mailto:[email protected]] On
Behalf Of Trinition
Sent: 01 April 2013 21:10
To: [email protected]
Subject: [nhusers] Lazy-load or batching of index-many-to-many keys?
18193

 

I have a class, Settings, which includes an
IDictionary<Area,AreaSettings> where all three types are entities.
Thus, my mapping looks like:

 

     <class class="Settings" ...>

          <map ...>

              <index-many-to-many ... class="...Area..." ... />

              <one-to-many class="...AreaSettings..." ... />

          </map>

     </class>

     <class class="...AreaSettings...">

          ...

          <many-to-one name="Settings" column="SettingsID" ... />

     </class>

 

Later in my code where I step on the collection to loop over it, there's
one query for the collection's contents, and then N queries for each of
the N children getting the Area:

 

     select ... from AreaSetings WHERE SettingsID=4 ...

     select ... from Area WHERE AreaID=1...

     select ... from Area WHERE AreaID=3...

     select ... from Area WHERE AreaID=4...

     select ... from Area WHERE AreaID=6...

     select ... from Area WHERE AreaID=7...

     select ... from Area WHERE AreaID=8...

     ...

 

I don't need the Areas proactively loaded as I'm looping over the
collection.  If that's unavoidable, then I'd rather see them fetched in
batches.  I've read and thought I understood 'lazy', 'batch', 'fetch'
but the various combinations I've tried haven't changed anything.  I'm
guessing most of those affect the *values* in the IDictionary, not the
*keys*.

 

What do I need to do to either (a) lazy-load the keys of this
IDictionary or (b) more efficiently load the keys?

 

-- 
You received this message because you are subscribed to the Google
Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to