tags:

views:

67

answers:

1

I'm fairly new to HQL / NHibernate so this may be a bit of an amateurish question. Basically I have a bidirectional many-to-one association. In my query, I am trying to find all of the “parent” entities that contain “children” that match a certain criteria.

I really don’t want to run the first query on the children and then query the parents by a list of IDs as I figure there has got to be a better way of doing this.

Thanks

Edit: I can't use a Sproc b/c they apparently don't believe in them here...yes, yes, I know.

+1  A: 

It would be something like :

select p from Parent
join p.Children c
where c.Property = 'some_value'

Also have a look at The NHibernate Query Language

sirrocco
Thank you, that certainly helped.
Chance
Glad I could help :)
sirrocco