Hello Christian,
Where you have
public class Foo
{
...
}
I use
@PersistenceCapable(identityType = IdentityType.APPLICATION,
detachable = "true")
public class Foo implements Serializable
{
...
}
instead. The "@PersistenceCapable" tag might help(?)
Ian
On Jul 20, 7:18 pm, Christian Edward Gruber
<[email protected]> wrote:
> Hi,
>
> I have a Model something like this...
>
> public class Foo {
> �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> �...@primarykey private Key id;
>
> �...@element(dependent = "true")
> �...@persistent(mappedBy="foo") private Set<Bar> bars = new
> HashSet<Bar>();
> ...
>
> }
>
> public class Bar {
> �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> �...@primarykey private Key id;
>
> �...@persistent private Foo foo;
> ...
>
> }
>
> ... on appengine-java. It's all fine and dandy for adding
> relationships, saving Foo (and Bars get saved)... but when I go to
> remove Bars, then save, the transaction seems to go through fine, but
> the no-longer-present Bars aren't deleted from the datastore, whicn
> means they still exist, with the "Foo" key (visible on manual
> inspection of the datastore), and then on the next fetch, they
> magically re-appear in Bar's relationship.
>
> So... is it my responsibility to manually manage deletions of such
> dependent entities (note, a Bar can't exist outside of a Foo
> meaningfully), or is it something that JDO's supposed to do for me.
> And if so, what am I forgetting to set, configuration wise to ensure
> that JDO deletes it properly.
>
> I fear it may be because I'm detaching these elements then re-
> persisting them in another web request, and so there's some underlying
> state management I'm missing...
>
> The important thing is that I need the deletion off the Foo to occur
> in one or more requests, where the "save" operation occurs in the
> "last" request (so to speak). So this is conversational state. (in
> case that matters)
>
> Christian.
--
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.