title: Hibernate composite element mapping
body: <p>I have the following relationship: Form --[order]-- Attribute.
  One form has n attributes and an attribute can belong to n forms. The relation requires to save an extra property : order.</p>
  
  <p>So I have a class form, a class attribute and a class form_attribute like this:</p>
  
  <pre><code>public class FormAttribute{
      Form form;
      Attribute attribute; 
      int attrOrder;
  
       // getters/setters
  }
  </code></pre>
  
  <p>On the Form mapping I am mapping like this:</p>
  
  <pre><code>&lt;set name="attributes" table="form_attribute" inverse="true" cascade="all-delete-orphan" order-by="attrOrder" &gt; 
      &lt;key column="form" not-null="true"/&gt;
      &lt;composite-element class="FormAttribute" &gt;
          &lt;many-to-one name="attribute" column="attribute" class="ExamAttribute" not-null="true" cascade="save-update" /&gt;
          &lt;property name="attrOrder" column="attr_order" type="integer" not-null="true" /&gt;
      &lt;/composite-element&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>when I create a new form and associate attributes I expect when, I save, to see the form_attribute table populated. But only form and attribute table is. Is it normal? Do I have to manually update the form_attribute relationship?</p>