Hi, Niclas, I found that If I use OrgJson instead Jackson as 
SerializationService implementation, Property<Enum> in EntityComposite is ok.
Does this remind you what's the difference between these two json 
implementation in order to fix Jackson implementation? Thanks.




------------------ ???????? ------------------
??????: "Niclas Hedhman";<[email protected]>;
????????: 2016??4??15??(??????) ????12:09
??????: "dev"<[email protected]>; 

????: Re: Property<enum> in ValueComposite ok, EntityComposite fail?



The explanation is that the serialization system for Values and Entities
are in reality different in 2.1 and older. That is largely due to
historical reasons, and we are successively trying to narrow the gap. There
are quite a lot of areas where similar functionality has multiple
implementations and therefor different set of bugs (or as some people call
it, undesirable features)

It is great that you uncover some of these, so we can get a regression test
into the codebase and make sure it is covered during the refactoring that
is ongoing.

Cheers

On Fri, Apr 15, 2016 at 11:33 AM, zhuangmz08 <[email protected]> wrote:

> 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
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java

Reply via email to