1 2 Previous Next 15 Replies Latest reply: Dec 9, 2010 1:04 AM by 712739 Go to original post RSS
      • 15. Re: Cannot evolve PersistentProxy?
        712739
        Hi,

        To get the rawType of the enum type, the DPL's catalog must have created the EnumFormat for this enum type. If you do not use enum type as a field (not a component in a map, but other kinds of fields) in any of your persistent class, then DPL's catalog will not create EnumFormat for this enum type.

        As Mark suggested, one possible solution is directly call EntityModel.registerClass to register the enum type. But since enum type is not annotated as @persistent in your code, if you have not use this enum type to read/write the data before, then calling EntityModel.registerClass for this enum type is not allowed.

        If so, one possible workaround I can think is that, make a new persistent class, which contains a enum type field. Just like (assume the enum type you defined is MyEnum):
            @Persistent
            static class enumPersistent {
                MyEnum a;
            }
        Then calling EntityModel.registerClass to register enumPersistent.class. So the MyEnum type will be registered, and a EnumFormat for MyEnum type is created. After that, you can call EntityModel.getRawType to get the RawType for the MyEnum RawObject you made.

        This workaround can work well in my sandbox, and can solve your problem, which means the conversion class works well for the class changed.
        1 2 Previous Next