db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francois Orsini" <francois.ors...@gmail.com>
Subject Re: Cannot delete on many-to-many relationship
Date Wed, 30 May 2007 21:09:46 GMT
Hello Tuan,

How are you handing referential integrity in your application? are you using
triggers or are you using referential contraints (cascade deletes) - Would
be helpful if you could post a bit more details about your data schema
definitions or/and a reproducible case...

Thanks, --francois

On 5/29/07, Tuan Nguyen Minh <tuannguyenminh@globalcybersoft.com> wrote:
>
>  Hi all,
>
> I'm a new user of derby. I have a problem want to support:
>
> When executing the statement
>
>
>
> em.createQuery("delete from Subject").executeUpdate();
>
>
>
> where Subject is in a many-to-many relationship with Book, and Subject owns the relationship,
>
> one expects that the corresponding entry in the SUBJECT_BOOK table would be deleted.
 This
>
> happens when bulk deleting one-to-many relationships that are mapped with a join table,
as
>
> well as for *-to-one relationships mapped with a foreign key.  It also happens when individually
>
> deleting objects.  However, it does not happen when bulk deleting the owning side of
a many-to-many
>
> relationship.
>
>
>
> Thanks & best regards,
>
>     Tuan Nguyen
>

Mime
View raw message