File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Blog around the Campfire and the fly likes Simple Hibernate Example with Enums Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Other » Blog around the Campfire
Bookmark "Simple Hibernate Example with Enums" Watch "Simple Hibernate Example with Enums" New topic
Author

Simple Hibernate Example with Enums

Christopher Rygaard
Ranch Hand

Joined: Feb 22, 2014
Posts: 42
    
    3
Simple Enum Example

This is the simplest stand-alone Hibernate Enum example I could cook up.

The interesting part is the annotation on MyPersistentObject._myEnum. Also notice that I don't need to register the Enum with Hibernate (eg. call addAnnotatedClass(...)).

Notice: This is provided with no warranty whatsoever. Use at your own risk.

This is the Enum:

This is the class that has an instance of the Enum:

This is how I use it:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple Hibernate Example with Enums