title: Grails / GORM - equivalent to JPA @ElementCollection
body: <p>I have a composition pattern where a parent object has a list of child objects, e.g., Order and LineItem.</p>
  
  <p>It behaves similar to cascading with delete orphans, but the child objects are @Embeddables instead of @Entities, and don't get their own IDs - they're always managed through their parent object.</p>
  
  <p>In JPA I could do something like this to ensure that whenever I save an Order, the collection of LineItems synchronize, including deleting removed items:</p>
  
  <pre><code>public class Order {
    @ElementCollection
    @CollectionTable(...)
  
    private Set&lt;LineItem&gt; items;
  
  }
  </code></pre>
  
  <p>In Grails, what's the equivalent?</p>
  
  <p>I can do hasMany with cascade all-delete-orphan but would prefer if there were a similar way for the child objects to not have their own IDs (basically, not be entities).</p>