Castor JDO requires a relationship to be bidirectional. Not a very nice limitation, but...
Thomas -----Original Message----- >From: John Wang [mailto:[EMAIL PROTECTED]] >Sent: Thursday, December 20, 2001 2:37 PM >To: [EMAIL PROTECTED] >Subject: Re: [castor-dev] foreign key assignment for dependant objects > >I have the same problem as you, I have asked the question too, " >Why use add***() on the primary object don't update the foreign key on the >foreign table? > >and I think it is a bug, itsn't it? > > >----- Original Message ----- >From: "Edward Hicks" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Wednesday, December 19, 2001 10:01 AM >Subject: [castor-dev] foreign key assignment for dependant objects > > >> I have 2 classes: Article and dependant class Segment. a Segment >> collection is mapped to Article with <sql many-key="articleid"> >> >> without having to map the foreign key column "articleid" to a field in >> Segment, castor can load an Article along with the Segment collection >> just fine. this is good. >> >> going the other way, i wanted to be able to modify the Segment >> collection of an Article, adding new Segment instances, and persist the >> Article back to the database with db.update(). >> >> castor does create new Segments in the database, but doesn't write the >> Article id into the foreign key column. it seems castor should be able >> to do this in the case of dependant classes. >> >> i hunted around the mail archives, but couldn't find anything on this. >> i also looked in the persistence source code, but only found dependency >> checking for superclasses. >> >> is there any way castor can perform this update successfully without >> having to map the fields for foreign keys? >> >> i'm specifically trying to avoid mapping foreign key fields so as to >> decouple the java classes from the relational tables as much as >> possible. >> >> thanks, >> ed hicks >> >> ----------------------------------------------------------- >> 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 > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
