Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DTOs with properties typed 'any' #116

Merged
merged 1 commit into from Jun 23, 2015

Conversation

tareksha
Copy link
Contributor

1- Serialzie and de-serialize JsonElement properties as raw JSONs
2- Deep-copy them in the generated copy constructors
3- Avoid redundant copying in fromJsonString() and toJson() cases

Signed-off-by: Tareq Sharafy tareq.sharafy@sap.com

@vparfonov
Copy link
Contributor

can you provide the same for functionality for client side DTO templates (DtoImplClientTemplat.java)

@tareksha
Copy link
Contributor Author

Hi @vparfonov,
Sorry for delay.
I noticed that the tests do not generate client implementations for the DTOs. I looked into that and noticed that the client generates GWT JSON code, which means JsonElement is not suitable as a cross-environment type. I suggest using Object instead, which evaluate to JSONValue in client and JsonElement in server. Sounds fine?

@tareksha tareksha changed the title Support DTOs with properties typed 'any' through JsonElement Support DTOs with properties typed 'any' Jun 18, 2015
1- Serialzie and de-serialize Object properties as raw JSONs
2- Deep-copy them in the generated copy constructors
3- Avoid redundant copying in fromJsonString() and toJson() cases

Signed-off-by: Tareq Sharafy <tareq.sharafy@sap.com>
@vparfonov
Copy link
Contributor

Hi @tareqhs looks good i just have two question:

  1. Did you make some test with client-side DTO generation?
  2. What means "Int" in fromJsonObjectInt(boolean)?

@tareksha
Copy link
Contributor Author

Hi @vparfonov,
Thanks for the review.

  1. The current code has no tests for client code at all, but i did add the client-side generation with relevant dependencies to make everything compiles (which wasn't done before). I would be glad if we lay out tests for all client code.
  2. Int just stands for 'Internal', added this to avoid generating overloaded functions because this is problematic in client code (e.g. JS).

vparfonov pushed a commit that referenced this pull request Jun 23, 2015
Support DTOs with properties typed 'any'
@vparfonov vparfonov merged commit a3935d9 into codenvy-legacy:master Jun 23, 2015
@tareksha tareksha deleted the dto_any_fields branch June 24, 2015 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants