| Author |
Hibernate: java.lang.ClassCastException: java.util.GregorianCalendar
|
Dave Alvarado
Ranch Hand
Joined: Jul 02, 2008
Posts: 434
|
|
Hi,
I'm using Hibernate 3.3.2 .GA. I have a Java model in which one column of the model maps to an Oracle DATE column that can be null.
However, when I try and get results that include one of these columns with the null value,
I get the error below. Any ideas why? I have included the complete class below the stack trace.
Thanks, - Dave
Stack trace ...
Model class
|
 |
Victor Dolirio
Ranch Hand
Joined: Aug 21, 2008
Posts: 56
|
|
I think that the problem is in this line:
As I guess that at least one of the variables startDate and endDate is of type GregorianCalendar. You must pass a Date once you have mapped it as a Date.
Try something like this:
Hope to help you.
|
If happen something bad in you life, don't ask God why it happened. Ask for what.
SCJP 5 (80%) - SCWCD 5 (91%) - SCBCD & SCJD coming soon...
|
 |
 |
|
|
subject: Hibernate: java.lang.ClassCastException: java.util.GregorianCalendar
|
|
|