JPA CascadeType.ALL does not delete orphans.

Posted by Paul Whelan on Stack Overflow See other posts from Stack Overflow or by Paul Whelan
Published on 2008-11-20T17:31:32Z Indexed on 2010/05/28 11:22 UTC
Read the original article Hit count: 216

Filed under:
|
|
|

I am having trouble deleting orphan nodes using JPA with the following mapping

@OneToMany (cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "owner")
private List<Bikes> bikes;

I am having the issue of the orphaned roles hanging around the database.

I can use the @org.hibernate.annotations.Cascade Hibernate specific tag but obviously I don't want to tie my solution into a hibernate implementation.

Any pointers greatly appreciated.

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate