Entity is an expando and that is indeed the way they work.
On Tue, Jul 20, 2010 at 5:32 AM, Marc Hacker <[email protected]> wrote:
> Surely this is not intended! Entity.getProperty() gives exactly the
> same result, null, if there is no property, there is a property set to
> null or there is an empty Collection!
>
>
> DatastoreService datastore =
> DatastoreServiceFactory.getDatastoreService();
> Key key = KeyFactory.createKey("testKind", "testKey");
> Entity e = new Entity(key);
> e.setProperty("null", null);
> e.setProperty("emptylist", new ArrayList<String>());
> datastore.put(e);
> try {
> Entity e2 = datastore.get(key);
> System.out.println(e2.getProperty("null")==null);
>
> System.out.println(e2.getProperty("emptylist")==null);
>
> System.out.println(e2.getProperty("doesNotExist")==null);
> } catch (EntityNotFoundException exc) {
> exc.printStackTrace();
> }
> Result:
> true
> true
> true
>
> At the very least an empty list should be saved as an empty list no?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>
--
--
Jeff
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.