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)