users@glassfish.java.net

Many To Many Question

From: <glassfish_at_javadesktop.org>
Date: Sun, 18 Nov 2007 14:57:25 PST

Hi, I'm trying to verify my understanding of how Many to Many relationships should be designed. My scenario is basically that I have a list items and categories. An item can belong to many categories.

When defining the relationship does it matter which class is defined as the relationship owner and which is the "mapped by" class? What are the pro's and con's?

Also, since both classes have defined their own collections, when I want to add a category to an item, do I need to add to both collections or just 1?

Thanks!
[Message sent by forum member 'fsa3' (fsa3)]

http://forums.java.net/jive/thread.jspa?messageID=245979