Hi,
I am confuced about using many-to-any mapping
The scenario is
I have Intitute class which contain a set of employee.As the employee can be of different implimentation of GenUser interface , i have defined teh set liek this
Code:
private Set<GenUser> empSet;
There are 2 different implmetation of GenUser IntituteEmployee and EccInstituteEmployee.I am using many-to-any mapping in my hbm to have inheritance polymorphism (table per concrete class).
Code:
<set name="empSet" cascade="all">
<key column="INSTI_ID"/>
<many-to-any meta-type="integer" id-type="integer" >
<meta-value value="2" class="com.scientia.dms.commons.vo.InstituteEmployee" />
<meta-value value="1" class="com.scientia.dms.commons.vo.EccInstiEmployee"/>
<column name="INSTI_TYPE" />
<column name="EMP_ID"/>
</many-to-any>
</set>
First I would like to know is this (ie using many-toany) is the right approch?
Secondly ,I am getting
java.lang.UnsupportedOperationException: any types do not have a unique referenced persister
when I load the Institute object.
Can anybody tell me what I am missing here ?
With Ragrds
Shaiju