• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple Hibernate Example with Enums

 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic