I have a collection mapping like this:
Code:
<hibernate-mapping>
<class name="my.FooImpl" table="foo_table">
<id name="mId" column="id" type="long" access="field">
<generator class="sequence">
<param name="sequence">foo_seq</param>
</generator>
</id>
<set name="bars" table="my_link_table" access="field" lazy="true">
<key column="child_id"/>
<many-to-many column="parent_id" class="my.FooImpl"/>
</set>
</class>
<class name="my.BarImpl" table="bar_table">
<id name="mId" column="id" type="long" access="field">
<generator class="sequence">
<param name="sequence">foo_seq</param>
</generator>
</id>
<property name="type" column="type" type="string"
</class>
</hibernate-mapping>
I'm having trouble with the "where" attribute of FooImpl.bars. How do I limit the contents of the set to only those isntances of BarImpl that have a specific value for "type"?
I was thinking of something like this:
Code:
where="my.BarImpl.type='something'"