This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Java 5, ENUM and Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Java 5, ENUM and Hibernate" Watch "Java 5, ENUM and Hibernate" New topic

Java 5, ENUM and Hibernate

Angela Stempfel

Joined: Nov 27, 2001
Posts: 15
hi all

i have some problems with the flexible enum solutiion described here:
The following error occurs when calling the nullSafeGet method:

my method looks like that:

My Enum class:

And here the parts of my mapping file:

Some help appreciated! Other solutions with UserTypes and ENUM's are welcome as well.

Kind Regards
[ August 30, 2006: Message edited by: Angela Stempfel ]
Angela Stempfel

Joined: Nov 27, 2001
Posts: 15
i finally found the solution! the method fromInt must be defined as static!

I agree. Here's the link:
subject: Java 5, ENUM and Hibernate
It's not a secret anymore!