• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with nullable enum fields + Hibernate 3

 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic