How do I set a restriction against an entity where the property is a set of subordinate classes?
In this case I have a parent entity 'FullExpertise' that has a set property consisting of one or more 'Keyword' instances. My search is to find all the 'FullExpertise' instances that have a link to a Keyword with an nominated keyword ID, like...
Code:
public FullExpertise[] findByKeyword(int aKeywordID);
This is the higher level entity mapping...
Code:
<class name="com.eis.knowledge.expertise.search.FullExpertise" table="expertise">
<id name="ID" type="java.lang.Integer" unsaved-value="-1">
<column name="ExpertiseIntID" />
<generator class="native" />
</id>
....
....
<set name="keywords" inverse="true" table="expertise_keyword_link">
<key>
<column name="ExpertiseIntID" not-null="true" />
</key>
<many-to-many column="EntityKeywordIntID" class="com.eis.keyword.Keyword" order-by="EntityKeywordTitle"/>
</set>
</class>
This is the lower level 'Keyword' entity mapping...
Code:
<class name="com.eis.keyword.Keyword" table="entity_keyword" >
<id name="ID" type="java.lang.Integer" unsaved-value="-1">
<column name="EntityKeywordIntID" />
<generator class="native" />
</id>
<property name="title" type="java.lang.String">
<column name="EntityKeywordTitle" length="100" not-null="true" />
</property>
</class>
Any ideas?