• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: java.lang.ClassCastException: java.util.GregorianCalendar

 
Dave Alvarado
Ranch Hand
Posts: 436
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic