OnDelete « Cascade « JPA Q&A





1. Trying to understand difference in CascadeType.ALL vs. @OnDelete!    stackoverflow.com

Let me get my question straight, using the @OnDelete here will delete this and any other InventoryPreference entities if the Inventory entity is deleted? I just can't understand a thing from ...

2. Hibernate: OnDelete vs cascade=CascadeType.REMOVE    stackoverflow.com

What is the difference between @OnDelete(action=OnDeleteAction.CASCADE) and cascade=CascadeType.REMOVE I read here: Is there an equivalent annotation for OnDelete in JPA2 that with @OnDelete(action=OnDeleteAction.CASCADE) the cascade will be handled by the DB, while ...

3. OnDelete Cascade on JPA with annotations only (DB2Dialect)    forum.hibernate.org

Hello, I have red all JPA OnDelete forum threads, but these are not finished with a solution. I want to test DELETE CASCADE on DBMS side with JPA and annotations only an got problems. I have a class Items that has Many Item elements : @org.hibernate.annotations.Fetch(value = org.hibernate.annotations.FetchMode.SUBSELECT) @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) @org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.DELETE_ORPHAN } ) @OneToMany(targetEntity = com.Item.class, cascade = ...