-->
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.  [ 2 posts ] 
Author Message
 Post subject: List Mapping Returns List with nulls
PostPosted: Tue Sep 13, 2005 6:34 pm 
Newbie

Joined: Tue Sep 13, 2005 6:23 pm
Posts: 9
I am trying to code a 1-many mapping inside a List element like so:

<list name="inputProcessSteps_Hibernate">
<key column="cmpnt_typ_c"/>
<index column="STEP_ID_N"/>
<one-to-many class="com.nppc.mes.productsupply.productdefinition.InputProcessStep"/>
</list>

When I check the parent object, it contains a list with the 5 elements I expect, plus 10 nulls, which are not expected.

When I change the mapping to use set:

<set name="inputProcessSteps_Hibernate">
<key column="cmpnt_typ_c"/>
<one-to-many class="com.nppc.mes.productsupply.productdefinition.InputProcessStep"/>
</set>

I get a collection with the 5 expected elements only.

Why does List generate the unexpected nulls?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 8:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
If the index value set has gaps in the sequence (think array indexes) then each gap will result in a null entry in the collection.


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

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.