-->
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.  [ 6 posts ] 
Author Message
 Post subject: bag mapping bug
PostPosted: Sat Apr 02, 2005 4:41 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 3:25 pm
Posts: 22
With the new hbm2java tool, a <bag> is mapped to a Collection. After looking at the code, this is because Hiberate BagType class returns a Collection to identify the type. The bug seems to me on the hibernate side. Could anyone confirm?

Henri.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 02, 2005 5:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well...a bag is actually a collection....

..but in the previous hbm2java we defaulted to List since it is possible to use it as such. Please add a request to the jira so we can fix it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 02, 2005 12:51 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Personally I think Collection is the best default. A bag is not really a List, after all.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 02, 2005 2:15 pm 
Beginner
Beginner

Joined: Thu Jan 20, 2005 3:25 pm
Posts: 22
gavin wrote:
Personally I think Collection is the best default. A bag is not really a List, after all.


I understand your point but it would be much more usefull to have a bag mapped to a List. Unless bag can not garantee in some circunstances the order of its elements?

Henri.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 02, 2005 2:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Exactly, it does not. Read the documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 02, 2005 2:32 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Hi,

hdupre - a bag does not guarantee the ordering, the implementation in hibernate is just luckily an array list and thus a List can be used.

you should report the bug as an improvement to the rev.eng tools that you can override this.

_________________
Max
Don't forget to rate


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