File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Collection usage

 
Salil Vverma
Ranch Hand
Posts: 255
Hibernate Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I know that hibernate provides a range of collection to be used. These are List,Set,Map,Bag,Array and primitive-array.
Can some one please suggest on what situation, which collection should be used ?
If we use map, what would work as key and what would work as value ?
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Typically a Set is suggested if it will do the trick, when it does not I typically use a List. The important thing is to use the interface. The reason is HIbernate will provide its own implementation. I do not use any of the others.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic