Trying to do something like this (available in Hibernate 2.1.7):
Code:
IList memberTasks = sess.CreateCriteria(typeof(MemberTask))
.Add(Expression.Eq("Member", assignee))
.Add(Expression.IsNull("DateCompleted"))
.CreateCriteria("Task")
.AddOrder(Order.Asc("Name"))
.List();
in the Hibernate docs it looks like this:
Code:
List cats = sess.createCriteria(Cat.class)
.add( Expression.like("name", "F%")
.createCriteria("kittens")
.add( Expression.like("name", "F%")
.list();
Basically, I am querying the association class, but I need to do an "order by" on one of the fields of a component class. MemberTask is an association class between Member and Task with some extra data.
Any ideas using the CreateCriteria interface? I have a working example based on the CreateQuery interface but I really prefer Criteria.
TIA,
-devon