- All Implemented Interfaces:
- AttributeConverter<Enum,String>
public class EnumStringConverter
extends Object
implements AttributeConverter<Enum,String>
By default the OGM will map enum objects to and from
the string value returned by enum.name()
enum.name() is preferred to enum.ordinal() because it
is (slightly) safer: a persisted enum have to be renamed
to break its database mapping, whereas if its ordinal
was persisted instead, the mapping would be broken
simply by changing the declaration order in the enum set.
- Author:
- Vince Bickers