One of my fields is of enumeration type 'ActionType'. I persist it as
STRING value:
@Entity
@Table(name = "dialplan")
public class DialPlan {
...
@Enumerated(EnumType.STRING)
ActionType action;
}
When I read back the table using simple JPQL "Select X from DialPlan X",
everything else is read correctly but the value of this field is NULL
for all rows.
While persisting new entries, the field gets written to the database
correctly. Even queries like below select correct rows:
Query q = em.createQuery(
"SELECT x FROM DialPlan x where x.action = :action");
q.setParameter("action", action);
I haven't tried persisting as ORDINAL values.
Is it a bug? Has anybody else faced this?
My environment is openjap 0.97 in WebLogic 10.
-Ajay