-->
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: Mapping a List
PostPosted: Tue Jun 08, 2010 4:44 pm 
Newbie

Joined: Tue Mar 17, 2009 1:56 pm
Posts: 6
I have an association mapped as a List. There's a column in the table that the List data comes from, specifically for indexing the List. However, as records are deleted, the index in the List becomes sparse. Eg 0,1,4,5

When this happens the List can no longer be sorted using Collections.sort.

I've tried creating another ArrayList and populating in from the mapped List and using add(0, myObject), add(1, myObject) so as to create a non-sparse List. However the List is still sparse and sorting doesn't happen because of a null pointer. It corrects itself as soon as the index column is no longer sparse.

Why is this please, and does anyone have any suggestions?


Top
 Profile  
 
 Post subject: Re: Mapping a List
PostPosted: Tue Jun 08, 2010 5:24 pm 
Newbie

Joined: Tue Mar 17, 2009 1:56 pm
Posts: 6
Forget it, it was a silly question. It creates a load on null entries i the List.


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.