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: Bidirectional one-to-many re-sorting the indexed List
PostPosted: Mon Sep 13, 2004 9:15 am 
Beginner
Beginner

Joined: Wed Mar 10, 2004 9:51 am
Posts: 42
Location: France
Hibernate version:2.16

Hi there,

I've got myself a parent object called Property which contains
a List of PropertyImages.

Everything works a treat and is working fine.

Now the thing is this. I want my users to be able to move PropertyImages
up and down the index.

If an image is at 0 it will be the first image displayed on the page.
If it is at 1 it will be second etc etc.

Now the dirty way to do this would be to just go in there and
directly manipulate the indexes.

Ie increment one objects index and decrement the others.

Is this a very bad way to do this or is there a more elegant fashion ?

Even more so, will I have to delete the List and recreate it from
scratch if I want to do this ?

I could just use a set and handle it all myself but I would like to
use the hibernate features if possible.

--b[/b]

_________________
Pesimist: The glass is half empty
Optimist: The glass is half full
Engineer:The glass should be half that size


Top
 Profile  
 
 Post subject: he he he
PostPosted: Thu Dec 02, 2004 2:36 pm 
Beginner
Beginner

Joined: Wed Mar 10, 2004 9:51 am
Posts: 42
Location: France
and here i am in december ... guess what ?? it was a bad idea !!!

--b

_________________
Pesimist: The glass is half empty
Optimist: The glass is half full
Engineer:The glass should be half that size


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.