I'm hoping to get a reference to the containing class from all objects in a map. Here's a partial mapping file:
Code:
<class name="Container" ...>
...
<map name="Items" ...>
<key column="ContainerID"/>
<map-key column="ItemID" type="integer"/>
<composite-element class="Item">
<parent name="Container"/>
<property name="ItemID" formula="ItemID" insert="false" update="false"/>
...
</composite-element>
</map>
...
</class>
But hibernate always passes null to Item.setContainer(). I'm assuming that it has something to do with being in a <map>, rather than being directly in the Container class. Is this the case? Is there a workaroud?
And while I'm here.. is the way I've included ItemID in the above example the best way to put the key for a particular value into that value?