-->
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.  [ 3 posts ] 
Author Message
 Post subject: any types do not have a unique referenced persister
PostPosted: Thu Jul 17, 2008 6:52 pm 
Newbie

Joined: Thu Jul 17, 2008 6:13 pm
Posts: 1
Hibernate version: 3.2.0.cr3

Mapping documents:

Code:
<class name="Collection" table="collection" lazy="false">
   <id name="id" column="id">
      <generator class="uuid"/>
   </id>
   
   <any name="data" meta-type="string" id-type="string" insert="true" update="true">
       <meta-value value="PROCESS" class="ProcessCollectionData"/>
       <meta-value value="PROJECT" class="ProjectCollectionData"/>
       <column name="type"/>
       <column name="data_id"/>
   </any>      
   ....
        ....
</class>

<class name="ProcessCollectionData" table="process_collection_data" polymorphism="implicit" lazy="false">
        <id name="id" column="data_id">
            <generator class="uuid"/>
   </id>
     
       .....
       ...
</class>
      
<class name="ProjectCollectionData" table="process_collection_data" polymorphism="implicit" lazy="false">
        <id name="id" column="data_id">
            <generator class="uuid"/>
   </id>
     
       .....
       ...
</class>   


Full stack trace of any exception that occurs:

Code:

java.lang.UnsupportedOperationException: any types do not have a unique referenced persister
   at org.hibernate.type.AnyType.getAssociatedEntityName(AnyType.java:322)
   at org.hibernate.loader.criteria.CriteriaQueryTranslator.getPathEntityName(CriteriaQueryTranslator.java:207)
   at org.hibernate.loader.criteria.CriteriaQueryTranslator.createCriteriaEntityNameMap(CriteriaQueryTranslator.java:191)
   at org.hibernate.loader.criteria.CriteriaQueryTranslator.<init>(CriteriaQueryTranslator.java:81)
   at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:59)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1550)
   at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
   at org.ifmc.qms.hibernate.dao.GenericDAO.find(GenericDAO.java:244)
   at org.ifmc.win.topic.ui.edit.editors.CollectionEditor$1.searchPerformed(CollectionEditor.java:804)
   at org.ifmc.qms.search.ui.forms.SearchForm.performSearch(SearchForm.java:244)
   at org.ifmc.qms.search.ui.forms.SearchForm.access$6(SearchForm.java:240)
   at org.ifmc.qms.search.ui.forms.SearchForm$ButtonForm$2.widgetSelected(SearchForm.java:428)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.ifmc.qms.rcp.Application.run(Application.java:35)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
   at org.eclipse.core.launcher.Main.run(Main.java:977)
   at org.eclipse.core.launcher.Main.main(Main.java:952)
org.ifmc.qms.hibernate.SearchException: java.lang.UnsupportedOperationException: any types do not have a unique referenced persister
   at org.ifmc.qms.hibernate.dao.GenericDAO.find(GenericDAO.java:250)
   at org.ifmc.win.topic.ui.edit.editors.CollectionEditor$1.searchPerformed(CollectionEditor.java:804)
   at org.ifmc.qms.search.ui.forms.SearchForm.performSearch(SearchForm.java:244)
   at org.ifmc.qms.search.ui.forms.SearchForm.access$6(SearchForm.java:240)
   at org.ifmc.qms.search.ui.forms.SearchForm$ButtonForm$2.widgetSelected(SearchForm.java:428)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.ifmc.qms.rcp.Application.run(Application.java:35)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
   at org.eclipse.core.launcher.Main.run(Main.java:977)
   at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.UnsupportedOperationException: any types do not have a unique referenced persister
   at org.hibernate.type.AnyType.getAssociatedEntityName(AnyType.java:322)
   at org.hibernate.loader.criteria.CriteriaQueryTranslator.getPathEntityName(CriteriaQueryTranslator.java:207)
   at org.hibernate.loader.criteria.CriteriaQueryTranslator.createCriteriaEntityNameMap(CriteriaQueryTranslator.java:191)
   at org.hibernate.loader.criteria.CriteriaQueryTranslator.<init>(CriteriaQueryTranslator.java:81)
   at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:59)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1550)
   at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
   at org.ifmc.qms.hibernate.dao.GenericDAO.find(GenericDAO.java:244)
   ... 27 more


Name and version of the database you are using: MySQL 5.0.20

The generated SQL (show_sql=true):

No SQL is generated

[b]Description[b]

This exception is similar to what was reported in the following forum post:

http://forum.hibernate.org/viewtopic.php?p=2350305&sid=cb9f480f1d73709a881af29f9d65246b

The exception is thrown when I attempt a criteria search on an attribute of the either of the concrete claases (ProjectCollectionData or ProcessCollectionData)


Top
 Profile  
 
 Post subject: Re: any types do not have a unique referenced persister
PostPosted: Mon May 09, 2011 8:43 am 
Newbie

Joined: Mon May 09, 2011 8:37 am
Posts: 3
Hi, Were you able to find any resolution for this problem?


Top
 Profile  
 
 Post subject: Re: any types do not have a unique referenced persister
PostPosted: Mon May 09, 2011 9:44 am 
Newbie

Joined: Mon May 09, 2011 8:37 am
Posts: 3
Hi, Were you able to find any resolution for this problem?


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

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.