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.  [ 1 post ] 
Author Message
 Post subject: Bag or set? which one is the best?
PostPosted: Wed Jul 15, 2009 8:43 pm 
Newbie

Joined: Mon May 14, 2007 1:57 am
Posts: 12
Hi there,

I've been using bags for a while, but recently I make use of sets. I've seen some differences but I really would like to hear the advice from an expert: which one is best, bag or set? performance, scalability, etc.?

I know that when using sets I must implement equals and hashcode, which leads to the "object id vs business key" problem (https://www.hibernate.org/109.html). Also, I read that I must use sets in nhibernate.

Reagarding bags, I've read that when I add or remove an item from the bag, the entire collection should be deleted/reinserted :S

What is the truth? what are today's best practices about it? I've search over different forums but I just found advices from newbies like me :S (no offense guys) and or very old posts.

Is there any expert that can share us his/her fresh-knowledge about this? which one is the best? performance? db hits? scalability?

Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.