Hello,

I need to persist enum values as a string.
This example 
http://www.java2s.com/Tutorial/Java/0355__JPA/JavaEnumMappedToVarchar.htm
shows how to do it, using


  @Enumerated(EnumType.STRING)
  private Gender gender;

which will work fine. However To keep all the fields in all the
entities consistent, I need to use strings only.
And because I am using some enum in many places, I need to set the
default to persist by String. So is there a ways to omit the
@Enumrated annotation and still get it the String type persisted ?

For example, use only:

private Gender gender;


Thank you.

Reply via email to