Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with nullable enum fields + Hibernate 3

 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using following combinations for my application

1) Hibernate 3
2) MySQL 5.0.15-standard

And I am facing a problem when i select row (using findObjects) from table that has enum field and value of that field is null.

I understand that enum field should be not-null in database,but if its nullable why hiberate throws following error ? Is this a bug in Hibernate 3.0 ? Ideally it should check for not null before calling CharAt(0) method,but it seems it dose not.

Cheers
-Praful
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any one else under this sun getting same error ?

-Praful
[ November 10, 2005: Message edited by: Praful Thakare ]
 
John Mikhail
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm curious...there is no enum support in hibernate. Did you write your own custom UserType that you're mapping to? If so, if you can include that code it might shed some more light on the subject.

John
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic