[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5163?page=c...
]
Gail Badner updated HHH-5163:
-----------------------------
Fix Version/s: (was: 3.6.1)
4.0.0.Alpha1
I'm getting conflicts applying a patch to branch 3.6. Also, there are some minor API
changes, so I think it's best to fix this in 4.0.0.alpha instead.
ClassCastException when Hibernate tries to cache results using
ResultTransformer
--------------------------------------------------------------------------------
Key: HHH-5163
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5163
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.1, 3.6.0
Reporter: Strong Liu
Assignee: Gail Badner
Fix For: 4.0.0.Alpha1
When Hibernate executes a cacheable query using a ResultTransformer, it will attempt to
cache the results AFTER applying the ResultTransformer. The problem is that the
ResultTransformer may modify the data in a way that Hibernate won't understand it
anymore, and in this case it will generate a ClassCastException when trying to cache it.
---------------------------
this can be reproduced by CriteriaQueryTest with following change:
papa-pc:testsuite stliu$ svn diff
src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java
Index: src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java
===================================================================
--- src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java (revision 19246)
+++ src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java (working copy)
@@ -613,6 +613,7 @@
)
.addOrder( Order.desc("studentName") )
.setResultTransformer( Transformers.aliasToBean(StudentDTO.class) )
+ .setCacheable( true )
.list();
assertEquals(2, resultWithAliasedBean.size());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira