Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate List question

 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Ankur, please check your private messages.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic