You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by CASERO Jaime <JC...@covansys.com> on 2007/07/19 15:23:56 UTC

Deleting an instance from a Collection using update.

Hello all,

            I have several One-To-Many relations among my entities. I
expected that when I remove an instance from the collection, and update
the collection owner, the first one would be removed from the DB. But
the instance is still there. 

Searching the manual I discovered a propietary extension, by OpenJPA,
called "ElementDependent", specially designed for this purpose. I still
getting the same results.

 

            Is there any special setting needed to enable
"ElementDependent"? Can anyone confirm this feature support? If yes, a
simple example would be very appreciated.

 

            Thanks In Advance, regards.

 

Jaime Casero
 
Confidentiality Statement:
 
This message is intended only for the individual or entity to which it is addressed. It may contain privileged, confidential information which is exempt from disclosure under applicable laws. If you are not the intended recipient, please note that you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information. If you have received this communication in error, please notify us immediately by return email.
-----------------------------

Re: Deleting an instance from a Collection using update.

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi,

On Jul 19, 2007, at 6:23 AM, CASERO Jaime wrote:

> Hello all,
>
>             I have several One-To-Many relations among my entities. I
> expected that when I remove an instance from the collection, and  
> update
> the collection owner, the first one would be removed from the DB. But
> the instance is still there.
>
> Searching the manual I discovered a propietary extension, by OpenJPA,
> called "ElementDependent", specially designed for this purpose. I  
> still
> getting the same results.

Yes, if you have annotated the collection with ElementDependent, then  
removing the instance from the collection should delete the instance  
from the database.
>
>             Is there any special setting needed to enable
> "ElementDependent"? Can anyone confirm this feature support? If yes, a
> simple example would be very appreciated.

I don't know of any reason it wouldn't work. But I've not used it  
myself.

Craig
>
>             Thanks In Advance, regards.
>
> Jaime Casero
>
> Confidentiality Statement:
>
> This message is intended only for the individual or entity to which  
> it is addressed. It may contain privileged, confidential  
> information which is exempt from disclosure under applicable laws.  
> If you are not the intended recipient, please note that you are  
> strictly prohibited from disseminating or distributing this  
> information (other than to the intended recipient) or copying this  
> information. If you have received this communication in error,  
> please notify us immediately by return email.
> -----------------------------

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!