-->
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.  [ 4 posts ] 
Author Message
 Post subject: Will Hibernate keep the order for java.util.List?
PostPosted: Sun May 13, 2007 11:36 pm 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
Hello,

For ManyToMany or OneToMany association, Will Hibernate maintain the order of entities in the list?

@ManyToMany
public List<Foo> getFooList() { ... }

Add Foo2, Foo1, Foo3 in the list, then save it.
close session.

Then retrieve the entity from persistence, will the order in the list be:

Foo2, Foo1, Foo3? (same order)

If not, how to maintain the order?
Thanks
Dave


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 14, 2007 1:36 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Check @IndexColumn in the doc

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 15, 2007 12:45 pm 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
emmanuel wrote:
Check @IndexColumn in the doc


The doc did not say much

http://docs.jboss.org/ejb3/app-server/H ... olumn.html

What is the @IndexColumn for? How to keep the order that is set by end user? Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 15, 2007 1:18 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.