Hi Romesh, I do have a detached reference to the actual object with part of the attributes populated.
My solution to modify a persistant object today combined from the following steps: Steps to retrie & modificaty the persistant object --------------------------------------------------- 1. Retrieving and detaching the persisting object with specific Fetch Group 2. Making modifications in the persistant object Steps to saving the new modified object ---------------------------------------- 3. Retrieve the original object from the datastore with all the attributes (using its "Key" from the detached object) 4. Update the detached object with the missing attributes 5. Saving the detached object I was wondering if there is a way to save the 3rd and 4th steps to improve performance while avoid loosing unpopulated attributes values. I did try to set a FetchGroup before persisting the detached object, although it completly ignored it and reset the un-populated values to null. I guess FetchGroup is not for modify or create operation only to "fetch" information. In the relational world you have the option to update certain attributes/fields in a tabke without updating all the other attributes. I thought we can do it in Google JDO as well... On Sep 23, 3:09 pm, romesh soni <[email protected]> wrote: > Hi Luka, > > How are you updating the object without having a reference of actual object > to be updated. In such case, you should be first retrieving the actual > object from db and then change the attributes and then save that object. > This process doesn't result in any loss of data and you get what you want. > > Thanks > Romesh > > On Thu, Sep 23, 2010 at 5:40 PM, luka <[email protected]> wrote: > > Hi, > > > I have some JDO persistent objects which contains lots of attributes. > > So in some cases I use specific Fetch Groups and retrieve only some > > attributes which are relevant. > > In these cases when I change the attributes which I retrieved and try > > to update them the rest > > of the attributes (which I did not retrieved) are being reset to null. > > > Can I update only partial attributes in a JDO persisted object? > > > -- > > 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]<google-appengine-java%[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.
