Not using session.Get(), use HQL or Criteria instead. For example:
public static IList<T> GetAll<T>(this ISession session)
{
return session.CreateCriteria(typeof (T)).List<T>();
}
...
IList<Product> products = session.GetAll<Product>();
Do that first (with whatever entity type you are doing this operation on)
and then do your tree search.... You don't need to do anything special, NH
will wire up all relationships for you.
On Tue, Sep 23, 2008 at 3:06 PM, gatapia <[EMAIL PROTECTED]> wrote:
>
> Hi Ken,
> I tried the MultiQuery with scalars but this actually took slightly
> longer.
>
> Will, I dont really understand how you can session.Get() at all
> levels?
>
> I am now investigating how to eager fetch an entity. This seems
> possible but only at the highest level, eg: EntityX with Children1 and
> Children2, but not Children1's children.
>
> I will post again when I have more results.
>
> Fabio: I'm still on NH1.2, Upgrading is not an option just yet. And I
> don't think I would want to upgrade to a dev version anyway.
>
> Note: here are some results from my MultiQuery tests:
>
> Unoptimised
> ===========
> Serialising 3 EntityType1 Entities Took: 109.3715ms
> Serialising 103 EntityType2 Entities Took: 5937.31ms
> Serialising 3 EntityType3 Entities Took: 2703.0385ms
>
> Serialising 3 EntityType1 Entities Took: 46.8735ms
> Serialising 103 EntityType2 Entities Took: 1749.944ms
> Serialising 3 EntityType3 Entities Took: 46.8735ms
>
>
> Optimised (With Multi Query)
> ============================
> Serialising 3 EntityType1 Entities Took: 281.241ms
> Serialising 103 EntityType2 Entities Took: 6437.294ms
> Serialising 3 EntityType3 Entities Took: 2968.655ms
>
> Serialising 3 EntityType1 Entities Took: 15.6245ms
> Serialising 103 EntityType2 Entities Took: 1671.8215ms
> Serialising 3 EntityType3 Entities Took: 46.8735ms
>
> Thanks for all your help
>
> Guido Tapia
>
> On Sep 23, 4:39 pm, "Ken Egozi" <[EMAIL PROTECTED]> wrote:
>> you can also fire scalar queries to count what needs counting.
>> and use MultiQuery to run all of these in a single roundtrip
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---