This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Java 5, ENUM and Hibernate" Watch "Java 5, ENUM and Hibernate" New topic
Author

Java 5, ENUM and Hibernate

Angela Stempfel
Greenhorn

Joined: Nov 27, 2001
Posts: 15
hi all

i have some problems with the flexible enum solutiion described here:
http://hibernate.org/272.html
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
Angela
[ August 30, 2006: Message edited by: Angela Stempfel ]
Angela Stempfel
Greenhorn

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

angela
 
wood burning stoves
 
subject: Java 5, ENUM and Hibernate
 
Similar Threads
Reflection problem: object is not an instance of declaring class
Mapping enum in JPA/Hibernate
Hibernate Issue
JDBC Metadata - constructing CREATE of existing table..
Using Hibernate & JScience together?