On Mon, Sep 28, 2009 at 4:23 AM, John V Denley <[email protected]> wrote: > > I have just tried to add a float variable (not sure if variable is the > correct term) to an existing datastore class, and Im getting an error > now when trying to retrieve the data: > > com.google.gwt.user.server.rpc.UnexpectedException: Service method > 'public abstract java.lang.String[][] > com.ideba.net.client.AppointmentService.getAppointments > (java.util.Date,java.util.Date) throws > com.ideba.net.client.NotLoggedInException' threw an unexpected > exception: java.lang.NullPointerException: Datastore entity with kind > Appointment and key Appointment(130) has a null property named Paid. > This property is mapped to com.ideba.net.server.Appointment.Paid, > which cannot accept null values. > > This is understandable, but I cant work out how to get around this > issue. > > Ive tried setting the constructor to initiate it, but i didnt expect > that to work really as the existing data is already there! > > Ive also tried to create a function to work through the database > setting this variable to 0, but it came back with the same error... > > does anyone have any tips how to deal with this?
Well if it was Python I would say add "required=False" to the float type for the DB link, so whatever the equivalent is in Java. That may or may not work, but if it does then you could update them all to a value then change it back. In my own apps though, every DB class name I have an appended underscore then version number, I bump up that version number every time I make a change, I then make a conversion function to update all old ones to the new one (I also have a global variable that links to the latest class name, I use that everywhere in the code so I do not have to do a search and replace every time). It would use a lot of CPU doing updates if I had a lot of things, but for small things it works quite well. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
