Use the object types instead of the primitive types; that is, use Boolean instead of boolean, and Integer instead of int. They can be null. Then in your getter for them, check to see if they're null and if so, set them to whatever default value you've chosen, and then return it, unboxed (for example, return myBoolean.booleanValue() and myInteger.intValue()).
Szymon Malok wrote:
Hello, I have encountered a problem with adding additional field to my datamodel. I understood that existing entites get null values on added field, but null is not allowed on boolean and int for example? GAE won't even let me iterate entities to update these fields. Well in this case I had about 20 entities, so I created String field instead, than in Datastore Viewer changed field Type of each entity, but that is UGLY way. Is there any other solution?
-- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.