I feel certain that this is just a mapping issue, but since I can't find a solution...
I've got an object that contains a Map in which both the key and value are other objects. The Key object is a persistent object. The Value object contains a couple of other objects that represent Money. I am able to save these map elements with no problem. If I save one that has NULL values for the 'price' and 'discount' properties, then upon retrieving them the entire Value in the map is NULL. The PriceSnapshotItem object supports null values for price and discount, though.
Anyone spot anything that might be helpful? Here's a mapping snippet.
Thanks,
Dave
Hibernate version: 3.0.5
Mapping documents:
Code:
<map name="itemPrices" table="price_snapshot_item_price" sort="unsorted" cascade="all">
<key column="price_snapshot_id"/>
<index-many-to-many column="item_id" class="com.enttek.concessions.common.model.AbstractItem"/>
<composite-element class="com.enttek.concessions.backoffice.server.model.PriceSnapshotItem">
<nested-composite-element name="price" class="com.enttek.concessions.common.model.component.Money">
<property name="amount" column="price" access="field"/>
</nested-composite-element>
<nested-composite-element name="discount" class="com.enttek.concessions.common.model.component.Money">
<property name="amount" column="discount" access="field"/>
</nested-composite-element>
</composite-element>
</map>
Name and version of the database you are using: MySQL 4.25