-->
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 question
PostPosted: Mon Jun 02, 2008 12:51 pm 
Newbie

Joined: Thu Jul 27, 2006 2:04 pm
Posts: 4
Hello,

I am looking for suggestions on what is the best way to implement a hibernate collection. I have a column called" "SeqNBR" which indicates the location of the element in the collection.

An element in the collection is allowed to move from its position. My application needs that flexibility.

If I use the traditional ArrayList to implement this I could get the change in position and go through the list and change the sequence number for each of the elements affected. But it seems very inefficient.

The other implementation is use a Linked List. Here I can simply to move an elements I remove it from its original position and add it to its new location. But some how I think this is way to simple and I am missing something.

The last is use a sorted set (sorted using the sequence numbers) instead of a list and change the sequence numbers as and when elements are moved.

I am confused as to which is the better implementation or I am totally off base here and there is a different way of doing these things.

I would appreciate any help.

Thanks,

S.


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.