Hallo,
I have this class structure:
class Base{
public SubClass SubEntity{get;set;}
}
public class SubClass{
public IList<Parent> Parents{get;set;}
}
class Parent {
public IList<Child> Children{get;set;}
}
class Child{
public string AProperty{get;set;}
}
This ist the Query for getting my items:
return session.CreateCriteria<Base>()
.CreateCriteria("SubEntity.Parents", "Parents")
.CreateCriteria("Parents.Children", "Children")
.Add(Restrictions.Eq("Children.AProperty", avalue))
.SetResultTransformer(Transformers.DistinctRootEntity)
.List<Base>();
In my mappings lazy is set to false and fetchmode to join. Now
NHibernate fires 3 Queries. The First is for getting all data and its
the one i want. But then Nhibernate fires 2 extra queries for the two
bags and I have all Items in the collection. But what I want is a
subset of the items. Is there a way to avoid this 2 queries?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---