In my application, I have a fairly large object that has a complex
serialised object structure as a member:

@Basic
@Lob
@Column(nullable = false)
private List<Foo> fooElements;

Now, I try to modify a member of fooElements like this:

fooElements.get(0).setSomething(...);

When I do this, the main entity will not be updated in the datastore
since I never actually modified the member itself, only the content of
one of the elements in the list.

I have two questions:

1) Would I be better off making Foo an @Entity itself? Bear in mind
that I have on the order of a few hundred to a thousand or so elements
in the list and it is very important that it can be loaded very fast.
It is loaded hundreds of times for each update.

2) Regardless of the anser to the first question, is there a way of
telling the system that the main entity should be re-persisted? The
only solution I have come up with so far is the following:

fooElements = new ArrayList<Foo>(fooElements);

In other words, creating a new list which is a copy of the old one.
This feels somewhat inefficient, so I'm wondering what the best
solution is.

Elias
-- 
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.


Reply via email to