Hibernate version: 2.0
Hey guys,
I've built a simple class of which you can create a list of conditions to add to the criteria list of NHibernate to find a list by properties.
by this i'm also able to search on properties of many-to-one and one-to-one object properties
(for example select orders where Order.Customer.Name = "john")
example part:
Code:
case ObjectGetterConditionOperator.LessThanOrEqual:
crit.Add(Expression.Le(Projections.Property(cond.PropertyName), cond.PropertyValue));
break;
case ObjectGetterConditionOperator.Like:
crit.Add(Expression.Like(Projections.Property(cond.PropertyName), cond.PropertyValue));
break;
now i would like to create a part of this so i can also add criteria for one to many or many to many collections in an object.
(For example: select orders where Order.OrderItem.Product.Name = "fish")
My property would be an IList (<bag> in mapping)
Is this possible?
What Expression do i have to use to get a list of orders that have an orderitem that contains a specific product or even productname?