title: Hibernate bag with multiple elements
body: <p>I have a bag whose structure looks like this:</p>
  
  <pre><code>&lt;bag name="foo" fetch="select" table="table_of_foos"&gt;
      &lt;key column="foo_ids"/&gt;
      &lt;many-to-many class="Bar" column="bar_ids"/&gt;
  &lt;/bag&gt;
  </code></pre>
  
  <p>My "table_of_foos" table has two columns: "foo_ids" and "bar_ids", neither of which is unique. I want to add another column to this table that holds some information about the relationship of foos to bars, so that my table would hold three columns. Then, I want to be able to access this information in my webapp.</p>
  
  <p>Unfortunately, it doesn't seem as if I can add a property or an element to the bag. What I want to do is something like this:</p>
  
  <pre><code>&lt;bag name="foo" fetch="select" table="table_of_foos"&gt;
      &lt;key column="foo_ids"/&gt;
      &lt;many-to-many class="Bar" column="bar_ids"/&gt;
      &lt;element column="still_valid" type="integer"/&gt;
  &lt;/bag&gt;
  </code></pre>
  
  <p>What is the best way to accomplish this?</p>