Re: [appengine-java] How to handle class version issues in DataStore
That's not quite correct - in the low-level datastore, this isn't an issue because absent properties will simply be missing from the Entity. In Objectify, absent properties are ignored. You can add fields of primitive types without ill effect - they will simply have their default values. This is very useful when you add fields, or flag fields as not-saved when they have certain values (ie the default). I believe JPA/JDO will throw exceptions if you add a primitive type field to your entity and there is no corresponding property in the underlying loaded Entity. This is very poor behavior, IMHO. It creates a very brittle structure. Jeff On Mon, Mar 12, 2012 at 4:12 AM, Matthew Jaggard wrote: > This answer also applies to the low level datastore and Objectify. I can > only assume JPA works the same way. > > On Mar 12, 2012 7:40 AM, "andrew" wrote: >> >> Nulls (Java), if the object can have null as a value. E.g. Integer can be >> null, int cannot. >> >> I think this is explained in GAE/JDO documentation. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google App Engine for Java" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/google-appengine-java/-/GBfSKyvTztcJ. >> 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-java?hl=en. >> > -- > 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 [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-java?hl=en. -- 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 [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-java?hl=en.
Re: [appengine-java] How to handle class version issues in DataStore
This answer also applies to the low level datastore and Objectify. I can only assume JPA works the same way. On Mar 12, 2012 7:40 AM, "andrew" wrote: > Nulls (Java), if the object can have null as a value. E.g. Integer can be > null, int cannot. > > I think this is explained in GAE/JDO documentation. > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-appengine-java/-/GBfSKyvTztcJ. > 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-java?hl=en. > > -- 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 [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-java?hl=en.
[appengine-java] How to handle class version issues in DataStore
Nulls (Java), if the object can have null as a value. E.g. Integer can be null, int cannot. I think this is explained in GAE/JDO documentation. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/GBfSKyvTztcJ. 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-java?hl=en.
[appengine-java] How to handle class version issues in DataStore
Hello,
I have a question related to App engine Data Store. Lets say I have a
simple POJO class like this:
public class Employee implements Serializable {
private String name;
private Date birthDay;
...
...
}
I create an object of this class and store it in Data Store.
After this lets say if I had to modify the Employee class to include some
additional fields.
Now, when I retrieve the old Employee object that I had stored in Data
Store, do I get exception or object of new Employee class with new fields
null?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine-java/-/04UhBbvTqysJ.
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-java?hl=en.
