2014-08-08 17:38 GMT+02:00 Luis Limas <luiscl...@hotmail.com>:
> Thanks again for the reply Lukasz, you misunderstood me, im not doing
> serialize/deserialize my entities for any logic, the deserialize instruction
> is being called inside struts (Project: Struts 2 JSON Plugin,
> JSONInterceptor.java : 123) when parsing JSON to Map (before calling the
> setters inside JSONReader) and then to Object,  i mentioned the deserialize
> thing because there is where it seems to me that setters are not being
> called. The serialize instruction i only use it for debuging purposes so i
> was able to see how it looks the populated (final) object,

Yes I know, but you're exposing Hibernate entity directly not some VO
- it always will be an issue, as you can see [1], JSONWriter already
contains some logic to detect Hibernate bean, but JSONReader can't do
that.

> The issue seems to be that JSONWriter is not working propely. Also im not
> sure to understand what do you mean with "there's no way to do the
> opposite", isn't JSONReader doing that?

...create proper Hibernate entity from JSON - only Hibernate can do
that and creating entities by hand can cause some problems like your.

To clarify few things:
- JSONWriter serializes an object to JSON (writes to request)
- JSONRead deserializes JSON into an object (reads from request)

As I understand you have problem with converting JSON into an object?
So in that case JSONReader and JSONPopulator are involved.

[1] 
https://github.com/apache/struts/blob/aa744b811f9c41b80cc30ad6cf41ccaa75da5323/plugins/json/src/main/java/org/apache/struts2/json/JSONWriter.java#L290-L312


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to