Hi all,
My experience with NHibernate is limited, but I understand and have
verified that the following type of construction works -->
DetachedCriteria dc = DetachedCriteria.For(typeof(IPerson));
ICriteria criteria = dc.GetExecutableCriteria(session);
var result = crit.List();
Note that a criteria is created using a type which is an interface.
Now, when I'm creating a DetachedCriteria which I'm using in a
subquery, it stops working -->
ICriteria crit = session.CreateCriteria(typeof(IPerson));
DetachedCriteria dc = DetachedCriteria.For(typeof(IPerson));
dc.SetProjection(Projections.Id());
dc.Add(Expression.Eq("Id", 1));
crit.Add(Subqueries.Ne("Id", dc));
var result = crit.List();
it throws a MappingException: "No persister for: IPerson"
When I'm using typeof(Person) instead of typeof(IPerson) it does work.
What am I doing wrong here?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---