Grails / GORM - equivalent to JPA @ElementCollection -


i have composition pattern parent object has list of child objects, e.g., order , lineitem.

it behaves similar cascading delete orphans, child objects @embeddables instead of @entities, , don't own ids - they're managed through parent object.

in jpa ensure whenever save order, collection of lineitems synchronize, including deleting removed items:

public class order {   @elementcollection   @collectiontable(...)    private set<lineitem> items;  } 

in grails, what's equivalent?

i can hasmany cascade all-delete-orphan prefer if there similar way child objects not have own ids (basically, not entities).

you can use static embedded in order. refer this.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -