Hi, Niclas, I've declare the TestValue.class(containing a TestEnum) as both value and entity composite. Their behavior is different, value is ok, but entity is fail. One interesting thing is that, I put TestValue into a TestEntity, it's ok....
------------------ ???????? ------------------ ??????: "zhuangmz08";<[email protected]>; ????????: 2016??4??15??(??????) ????11:21 ??????: "dev"<[email protected]>; ????: ?????? Property<enum> in ValueComposite ok, EntityComposite fail? Hi, Niclas, I've post my code into [https://github.com/mingzhou/learn-zest]. Thanks. Do I need to declare every enum as entity or value composite? ------------------ ???????? ------------------ ??????: "Niclas Hedhman";<[email protected]>; ????????: 2016??4??15??(??????) ????10:54 ??????: "dev"<[email protected]>; ????: Re: Property<enum> in ValueComposite ok, EntityComposite fail? Do you do the equivalent of; public interface Abc { Property<MyEnum> myState(); } and in assembly doing; module.values( Abc.class ); module.entities( Abc.class ); and you get different results?? If so, then that is a bug. There should be no difference in the behavior here. In general, there should be no difference, but without seeing exactly what you are doing, it is difficult to know for sure. If you are only learning, could you publish your sources on GitHub and just point us to the code when you hit a snag? Easier for both us and you, I think Niclas On Fri, Apr 15, 2016 at 10:46 AM, zhuangmz08 <[email protected]> wrote: > hi, > public enum MyEnum{ > A, B, C, D > } > > > I use this enum in a ValueComposite and a EntityComposite, and try to > ser/deserialize it by using JacksonValueSerializationService. > However, value composite is ok, but entity composite throw exception > caused by [com.fasterxml.jackson.core.JsonParseException: Unrecognized > token 'A': was expecting ('true', 'false' or 'null')]. > I'm wondering whether this is a bug or not. > Thanks a lot. -- Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java
