Hi all,
We've been using NHibernate for about two years now, almost exclusively with
the Criteria API. It's always been a question among our development team why
one needs to explicitly add aliases for properties used in restrictions or
orders.
Example:
ICriteria q = session.CreateCriteria(typeof(OrderLine));
q.CreateAlias("Order", "Order");
q.AddOrder(Order.Asc("Order.DateIn"));
q.List();
If one omits the second line, NHibernate throws an exception because it does
not know how to apply the Order.DateIn order.
Wouldn't it be useful to be able to somehow set "Automatic Aliasing" to
true, and have NHibernate add the alias by itself by following the
"Order.DateIn" property path?
Same thing should happen with expressions e.g.
q.Add(Restrictions.Ge("Order.TotalPrice", 1000)) and projections.
Truth is I have not been following the recent 3.2 developments so if this is
somehow feasible there, excuse my ignorance.
Cheers
Marios
--
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.