openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jody Grassel <>
Subject Re: Child object deletion from tree
Date Wed, 20 May 2009 15:14:25 GMT
Good morning, JP

I don't think that the functional behavior you're interested in exists as of
yet in OpenJPA.  The JPA Spec defines operation cascading, where say, an
em.remove() operation invoked on an entity is also propagated along entities
in a relationship marked with the appropriate cascade type.  But there are
no annotations or collection implementation types with special methods which
imply that entities removed from a relationship out to have em.remove()
implicitly invoked on them.  Callback methods can't really be used either,
since the spec discourages the use of entitymanager operations within the
callback method body.

On Thu, May 14, 2009 at 6:41 PM, JayaPrakash <> wrote:

> Hi,
>           Is it possible to delete a child from an object tree while
> merging the whole object?
> For example I have an Order and a LineItem objects, and the Order has a
> onetomany relationship with LineItem. The Order has 5 LineItem objects and
> want to delete one of the LineItem objects when I do
> em.merge(lineItem);
> To accomplish this what I would like to do is, while I send the Order
> object
> to my DAO class, I would send only 4 LineItems in the list eliminating the
> 1
> LineItem which I wanted to be deleted from the Database.
> Can anyone let me know pls, if this kind of deletion is supported by
> OpenJPA?
> I appreciate everybody for taking a look at my post.
> Thanks,
> JP
> --
> View this message in context:
> Sent from the OpenJPA Developers mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message