com.avaje.ebean.annotation
Annotation Type PrivateOwned


@Target(value={FIELD,METHOD})
@Retention(value=RUNTIME)
public @interface PrivateOwned

Specify that the elements of a OneToMany are private owned.

This means that if they are removed from the List/Set/Map they will be deleted when their parent object is saved.

This could also be described as deleting orphans - in that beans removed from the List/Set/Map will be deleted automatically when the parent bean is saved. They are considered 'orphans' when they have been removed from the collection in that they are no longer associated/linked to their parent bean.


Optional Element Summary
 boolean cascadeRemove
          Set this to false if you don't want cascade REMOVE on this relationship.
 

cascadeRemove

public abstract boolean cascadeRemove
Set this to false if you don't want cascade REMOVE on this relationship.

That is, by default PrivateOwned implicitly adds a cascade REMOVE to the relationship and if you don't want that you need to set this to false.

Default:
true


Copyright © 2012. All Rights Reserved.