Hello,
I'm trying to retrieve a previously stored list of Java enums from my database, but I find the name to be null.
The enums are stored in a list which is a fields of another object - the entire structure looks roughly like:
public class container{
private final InnerContainer inner;
}
public class InnerContainer{
private final List<EnumClass> list;
}
"cascadeOnUpdate" is set to be true for both class and InnerContainer.class, in addition, I have enabled "persistStaticValues" for the EnumClass.
When examining the the stored instances of the enum in the db4o manager, their name and ordinal are both "null" (mind that ordinal is a primitive int, shouldn't be possible to be null.) , but when I look at them in a debugger (eclipse's standard debugger, in case it matters), the ordinal is set correctly.
Moreover, having a database with those wrong values stored breaks this enum entirely, since all references to those values that were previously stored return "null" as their name.
My question is twofold: For one, I'd like to know whether there is a way to retrieve and re-validate the existing database, or whether stored data is lost. In addition, it would be great if you could tell me how to avoid this problem in the future.
Thanks a lot
-Urs