-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: many-to-any
PostPosted: Sat Jan 03, 2009 12:23 am 
Newbie

Joined: Sun Feb 18, 2007 1:05 pm
Posts: 16
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.