java - Aggregation and Decomposition in JPA -


how implement aggregation , decomposition java persistence api? best practices?

thanks in advance, daniel

i've found orphanremoval attribute @onetomany , @onetoone relationships:

when target entity in one-to-one or one-to-many relationship removed relationship, desirable cascade remove operation target entity. such target entities considered “orphans,” , orphanremoval attribute can used specify orphaned entities should removed. example, if order has many line items, , 1 of line items removed order, removed line item considered orphan. if orphanremoval set true, line item entity deleted when line item removed order.

usage:

@onetomany(mappedby="customer", orphanremoval=true) public list<order> orders; 

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -