Message:
The following issue has been closed.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-527
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-527
Summary: Session.find throws ClassCastException when composite id is used and Class not Serializable
Type: Improvement
Status: Closed
Priority: Minor
Resolution: FIXED
Project: Hibernate2
Components:
core
Fix Fors:
2.1 final
Versions:
2.1 rc1
Assignee:
Reporter: John Caruso
Created: Fri, 5 Dec 2003 9:18 AM
Updated: Tue, 9 Dec 2003 4:41 PM
Environment: Hibernate 2.1 rc1, Oracle 8.1.7
Description:
Loader.java (line 347)
resultId = (Serializable) idType.nullSafeGet(rs, suffixedKeyColumns[i], session, null); //problematic for <key-many-to-one>!
The API docs say that session.find(String query) throws only a Hibernate Exception. The ClassCast Exception is thrown and perhaps can be avoided by using isAssignableFrom(java.io.Serializable.class) first and throwing a HibernateException describing that the class doesn't implement Serializable when it should. (This took me a while to figure out before actually going into the hibernate source code to find the source of the error)
I apologize if this bug is already known, however, I do not have time to cruise through the bug reports. Hibernate is a godsend. Keep up the good work! ;)
---------------------------------------------------------------------
JIRA INFORMATION:
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.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|