Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] JPA - deleting rows difficulty

Hi J.V.,

Are you using EclipseLink? The reason I ask is that you are talking about database rows and tables rather than Objects and relationships.

In EclipseLink, if you have properly mapped your objects, and manage your relationships properly, both the foreign keys and the "database agnosticness" are taken care of for you.

If you are using EclispeLink, can you provide a fairly small example of the the Entities you have, how they are mapped, the code you are running and the issue you are running in to?

Thanks,
Tom

On 15/06/2012 11:58 AM, J.V. wrote:
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.
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top