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: list-index sorting issue
PostPosted: Tue Apr 08, 2008 12:31 pm 
Newbie

Joined: Tue Apr 08, 2008 12:12 pm
Posts: 1
Hibernate version: 3.2.5
Name and version of the database you are using: Oracle 10g

The following use of <list> and <list-index> results in a java.util.List of 7 elements with a null for the 5th. I was expecting a List of *all* 6 elements without the null.

The documentation clearly states that the sort column is expected to be in sequential order. Given that my sort column is not in sequential order how can i modify the behavior of the <list-index> tag to sort *any* list of integers and *not* just sequential integers.

This would seem to be a fairly common behavior of sorting.

any help most appreciated.


Mapping documents:

Code:
<list name="elements" inverse="true" cascade="all">
  <key column="article_id"/>
<list-index column="sort_order" />
  <one-to-many class="eg.Element"/>
</list>



data:

Code:
article_id, sort_order
1013,0
1012,1
1034,2
1112,3
1223,4
2233,6



-lp


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.