At a more basic level I can't even get the HQL to work. So far I'm using...
Code:
select e from FullExpertise as e
inner join e.expert as x
inner join x.owners as w
where x.appUserID = ? or w.ID = ?
This returns zero records when I know it should return 8 records.
If I use...
Code:
from FullExpertise as e where e.expert.appUserID = ?
... this returns 4 records, so it's obviously something wrong with my join logic on the 'FullExpertise.expert.owners' part.
Here are snippets from the entity mappings....
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>
<many-to-one name="expert" class="com.eis.knowledge.expert.definition.FullExpert" fetch="join" lazy="false">
<column name="ExpertIntID" not-null="true" />
</many-to-one>
<class name="com.eis.knowledge.expert.definition.FullExpert" table="skap_expert">
<id name="ID" type="java.lang.Integer" unsaved-value="-1">
<column name="ExpertIntID" />
<generator class="native" />
</id>
<property name="appUserID" type="java.lang.Integer">
<column name="SkapUserIntID" unique="true" />
</property>
<set name="owners" inverse="true" table="expert_owner">
<key>
<column name="ExpertIntID" not-null="true" />
</key>
<many-to-many column="SkapUserIntID" class="com.eis.appuser.AppUser" order-by="SkapUserExternalID"/>
</set>
<class name="com.eis.appuser.AppUser" table="skap_user_extra">
<id name="ID" type="java.lang.Integer" unsaved-value="-1">
<column name="SkapUserIntID" />
<generator class="native" />
</id>
Any ideas?