I have an object that is mapped to have a set of objects, very simple. However, what I really want to do is put some criteria on that mapping. Here's the current mapping:
<set name="ops" inverse="true" cascade="all, delete-orphan">
<key column="cityblock_id" on-delete="cascade"/>
<one-to-many class="com.tamedtornado.data.Operation"/>
</set>
Now, instead of just getting all associated ops, I want to just get ops that haven't completed, or have, or whatever. The Hibernate docs are very quiet on this, although some old forum posts have shown me a little. You can apparently use a sql-query tag, but that's also not what I want to do.
Is there anyway to do this with an HQL query? I just want to narrow the results with a simple query and have a few collection maps, like active_ops and completed_ops, etc.
Cheers, Jason