Originally posted by Ilya Elkind:
Question 1: When doing One-To-Many or Many-To-One Mappings, is it better to Sets, Collections, HashMaps, ArrayList...ect?
Question 2: When doing Many-To-Many using hibernate annotations is there any strategy for implimenting the beans? Examples for the private members and thier getters/setters/collections would be very helpful.
Thanks!
Originally posted by Ilya Elkind:
I have another dillema.
I want to add a set of objects inside the object.
So for every user, there should be a set of "friends"
This is what i would normally do if i was working with collections.
Now this would normally work, if this was a 1 to Many mapping across another class, but this doesnt work becuase my setFriends method has to take a set of UserEnts.
Is there a way to set this collection set or should i not even bother with the add/remove methods?
Originally posted by Ilya Elkind:
Ok, but can you give me a workaround to my addFriends and removeFriends methods?
Originally posted by Ilya Elkind:
Also I'm still lost on the Many-To-Many mappings above.
Thanks