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.
|