Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349981 - [Hibernate] Typed parameter for XML type in querying gives ClassCastException
Summary: [Hibernate] Typed parameter for XML type in querying gives ClassCastException
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-21 14:57 EDT by Martin Taal CLA
Modified: 2019-11-08 03:15 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Taal CLA 2011-06-21 14:57:37 EDT
When the model uses types from the XMLTypePackage and you want to do querying on these typed efeatures, you get a CCE when setting parameters in the queries:


org.eclipse.net4j.signal.RemoteException: java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.String
	at org.eclipse.net4j.signal.RequestWithConfirmation.getRemoteException(RequestWithConfirmation.java:139)
	at org.eclipse.net4j.signal.RequestWithConfirmation.setRemoteException(RequestWithConfirmation.java:128)
	at org.eclipse.net4j.signal.SignalProtocol.handleRemoteException(SignalProtocol.java:423)
	at org.eclipse.net4j.signal.RemoteExceptionIndication.indicating(RemoteExceptionIndication.java:63)
	at org.eclipse.net4j.signal.Indication.doExtendedInput(Indication.java:55)
	at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
	at org.eclipse.net4j.signal.Indication.execute(Indication.java:49)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
	at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.ClassCastException: java.util.Date cannot be cast to java.lang.String
	at org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.XMLUserType.nullSafeSet(XMLUserType.java:174)
	at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:146)
	at org.hibernate.param.NamedParameterSpecification.bind(NamedParameterSpecification.java:67)
	at org.hibernate.loader.hql.QueryLoader.bindParameterValues(QueryLoader.java:571)
	at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1716)
	at org.hibernate.loader.Loader.doQuery(Loader.java:801)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
	at org.hibernate.loader.Loader.doList(Loader.java:2533)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
	at org.hibernate.loader.Loader.list(Loader.java:2271)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
	at org.eclipse.emf.cdo.server.internal.hibernate.HibernateQueryHandler.executeQuery(HibernateQueryHandler.java:143)
	at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:293)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	... 3 more
Comment 1 Martin Taal CLA 2011-06-21 14:59:52 EDT
Committed to cvs
Comment 2 Eike Stepper CLA 2011-06-23 03:37:57 EDT
Available in R20110608-1407