u don't have to have both sides of a relationship represented in your java objects. for example we have a many-to-many defined in the database. however only one of the two java classes involved contains a collection of the other.
we also have one-to-many relationships where we have done the opposite to your question. the child contains a reference to the parent, but the parent doesn't contain the collection of children. brad -----Original Message----- From: Robert Ollila [mailto:[EMAIL PROTECTED]] Sent: Friday, 30 November 2001 1:41 AM To: [EMAIL PROTECTED] Subject: [castor-dev] JDO class design constrained by RDBMS relational paradigm Hi all, I have been looking at the JDO "Product" example and I think I am concluding some significant drawbacks. In the example we have the top level "Product" class which contains a collection of "ProductDetail" objects. In order to model this containment in the RDBMS the ProductDetail class must contain a reference to the Product class which contains it. If we were just using the Java object without concern for persistance, we would not need to hold a "parent" reference in each of the collected objects. This seems like a significant drawback, especially if you are trying to persist existing classes which are not modelled this way. Is there another way to establish the one-to-many relationship in the RDBMS without changing existing classes which do not include references to the classes which contain them? In other words if the example ProductDetail class did not contain a Product reference, how would we map the one-to-many relationship? thanks, Bob. ====================================== Robert Ollila Software Engineer Vina Technologies 25 Manchester Street Merrimack, NH 03054 603-589-0669 ====================================== ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
