-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Null value object in persistent map when retrieved.
PostPosted: Mon Nov 05, 2007 3:45 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 2:22 pm
Posts: 27
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.