So i'm wondering what would be the best thing to do in order to
convert an Entity to Json. For now i convert entities in arrays that
GWT serialize, but that's an extra step.
Also would Entity to json or PreparedQuery results as json be an
acceptable feature request for gaelyk?
Gaelyk focuses on GAE SDK enhancements, and is not trying to be a
solution for every possible need, but at least, making such needs be
easily taken care of. So I tend to promote other cool
groovy/gaelyk-friendly technologies instead.
And in this case, I think you could leverage Entity's getProperties()
method, in combination with JSON-lib's groovy-friendliness and ability
to serialize maps as JSON.
So, say you have an Entity:
def person = new Entity("person")
person.name = "Guillaume Laforge"
def jsonString = person.properties as JSONObject
Have a look at JSON-lib and the Entity JavaDoc.
And I think it'll solve your problem pretty neatly!
--
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Gaelyk.
Pour envoyer un message à ce groupe, adressez un e-mail à gae...@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse gaelyk+un...@googlegroups.com.
Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/gaelyk?hl=fr
On Dec 29, 10:09 pm, Guillaume Laforge <glafo...@gmail.com> wrote:
> Hi Florian,
>
That's what I like about the facilities provided by Groovy, and
Groovy-friendly libraries. We don't even need a special support in
Gaelyk, it's working out of the box with an external library!
> --
>
> Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Gaelyk.
> Pour envoyer un message à ce groupe, adressez un e-mail à gae...@googlegroups.com.
> Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse gaelyk+un...@googlegroups.com.
> Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/gaelyk?hl=fr
>
>
>
--