polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhuangmz08" <zhuangm...@qq.com>
Subject 回复: Property<enum> in ValueComposite ok, EntityComposite fail?
Date Fri, 15 Apr 2016 03:21:20 GMT
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";<niclas@hedhman.org>;
发送时间: 2016年4月15日(星期五) 上午10:54
收件人: "dev"<dev@zest.apache.org>; 

主题: 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 <zhuangmz08@qq.com> 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
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message