-->
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: @OneToMany List is reversing on save!
PostPosted: Sun May 24, 2009 2:15 am 
Newbie

Joined: Sun May 24, 2009 2:00 am
Posts: 1
So I have a class with a

@OneToMany @Cascade({CascadeType.ALL})
List<MyOtherPersistentClass> collection;

And I am using the order of this list, and allowing the user to arrange the list and this DOES WORK, and I can persist the order of the list... and yet sometimes (it seems not all the time!) when I save() the object that contains this list, after ordering it, it comes up REVERSED from the order I set it at.

I'm going crazy on this, and it's so close to working, the order is affected and persisted, but it's somehow reversing! Anyone know why, how I can get it to stop or reliably compensate for it?

EDIT! I have figured out that the list order does NOT change when I don't do ANY changing of the order of the list. However, when I change the order AT ALL, now the order becomes the reverse of the order I've set to. ARGH! I'm going crazy, it seems like it shouldn't be doing this!

Thank you,
Joshua


Top
 Profile  
 
 Post subject: Re: @OneToMany List is reversing on save!
PostPosted: Wed Jun 17, 2009 9:08 am 
Newbie

Joined: Sat Jan 24, 2009 7:12 am
Posts: 9
i'm also having the issue using xml mapping:

Code:
<list name="notes" where="obj_type = 2" cascade="save-update">
         <key column="obj_id" not-null="true"/>
         <list-index column="note_index"/>
         <one-to-many class="ru.corporate.businessobjects.Note"/>
      </list>


somehow it pushes new items like in a stack (i've checked the database index field), and not like in a list

// now the list-index is just bouncing here and there


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.