openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: JPA - difficulty deleting rows (with child fkeys)
Date Mon, 18 Jun 2012 13:31:09 GMT
Hi J.V.,
Was your question posted as a "general inquiry" into the support within JPA
to accomplish this task?  Or, have you been experiencing issues with
OpenJPA's support of the CascadeType and/or @ElementDependent features that
John described in his reply?

Thanks,
Kevin

On Mon, Jun 18, 2012 at 12:55 AM, Boblitz John <John.Boblitz@bertschi.com>wrote:

> This may sound like a silly question, but are you using the CascadeType?
>
> Also the @ElementDependant annotation might help <- I use this and it
> works.
>
> Maybe an example of your mappings might help ...
>
> John
>
> > -----Urspr√ľngliche Nachricht-----
> > Von: J.V. [mailto:jvsrvcs@gmail.com]
> > Gesendet: Freitag, 15. Juni 2012 20:57
> > An: users@openjpa.apache.org
> > Betreff: JPA - difficulty deleting rows (with child fkeys)
> >
> > I have a parent table and want to delete a row but it has
> > 'child' tables with foreign keys pointing to the primary key
> > in the parent table.
> >
> > We support four DBMS (Oracle, MySQL, PostgreSQL, SQL Server)
> > and are adding more.
> >
> > The table structure is such that the child tables have child
> > tables and so on, probably if you follow it, 15 tables in all
> > need a row deleted to just delete a row in a parent table.
> >
> > I need a database agnostic way to 'delete cascade' a row,
> > even if the table was not created with this option. In other
> > words the framework would recursively find the leaf rows,
> > delete those first and then work it's way up to the parent
> > table and report any problems or throw an exception if this
> > were the case.
> >
> > I am looking for any/all solutions from anyone who has
> > actually done this and was able to get it to work on multiple
> > databases or any of the databases listed above.
> >
> > thanks
> >
> >
> > J.V.
> >
>

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