Enhancement 168 : ENHANCEMENT: Add support for delete orphan type feature
Priority 
Medium
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.2.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
28/10/2009
Updated 
28/10/2009
Type 
Enhancement
 
Attachments 
No attachments

Refer to http://www.avaje.org/topic-157.html

...

I think @DeleteOrphans would usually be used with CascadeType.ALL
But of course it might also be used without another cascade action, e.g. in conjunction with REMOVE: when the parent is removed, remove all items in the association. Additionally, when an item is removed from the association remove the item too.

 
Rob 04 Nov 09:26
Fixed in HEAD

Support for this has been added to HEAD.

The annotation is @PrivateOwned.

The effect is that Ebean will listen for beans that have been removed from the List/Set/Map.

If the parent bean is saved, then any bean that was removed from the List/Set/Map will be deleted - the beans are effectively passed to the ebeanServer.delete() method.

This does not require the standard CascadeType.ALL etc.

woResponse

Upload a file