RE: [Modelj-user] Perform_Save_Existing
Status: Beta
Brought to you by:
tom_tessier
|
From: Tom T. <tom...@ho...> - 2003-05-31 00:34:12
|
Hi Eric, Well, the software does in fact generate the performSaveExisting method for 1-N relationships, however the web GUI does not implement that feature yet. Tom >From: Eric Dunn <ed...@me...> >To: "'Tom Tessier '" <tom...@ho...> >Subject: RE: [Modelj-user] Perform_Save_Existing >Date: Mon, 26 May 2003 23:11:34 -0700 >MIME-Version: 1.0 >Received: from mail16.messagelabs.com ([64.124.170.131]) by >mc5-f38.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 26 May >2003 23:09:47 -0700 >Received: (qmail 9561 invoked from network); 27 May 2003 06:09:45 -0000 >Received: from diquil.merc-int.com (HELO merc-int.com) (64.242.155.19) by >server-21.tower-16.messagelabs.com with SMTP; 27 May 2003 06:09:45 -0000 >Received: from sunexbh01.merc-int.com (sunexbh01.merc-int.com >[64.242.153.21])by merc-int.com (8.11.2/8.11.2) with ESMTP id >h4R69j117574for <tom...@ho...>; Mon, 26 May 2003 23:09:45 -0700 >Received: by sunexbh01.merc-int.com with Internet Mail Service >(5.5.2653.19)id <LD8Z8CS7>; Mon, 26 May 2003 23:09:44 -0700 >X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP >X-VirusChecked: Checked >X-Env-Sender: ed...@me... >X-Msg-Ref: server-21.tower-16.messagelabs.com!1054015785!1530 >Message-ID: ><BA4...@sv...> >X-Mailer: Internet Mail Service (5.5.2653.19) >List-Help: <mailto:mod...@li...?subject=help> >List-Subscribe: ><https://lists.sourceforge.net/lists/listinfo/modelj-user>,<mailto:mod...@li...?subject=subscribe> >List-Unsubscribe: ><https://lists.sourceforge.net/lists/listinfo/modelj-user>,<mailto:mod...@li...?subject=unsubscribe> >Return-Path: ed...@me... >X-OriginalArrivalTime: 27 May 2003 06:09:47.0936 (UTC) >FILETIME=[93851A00:01C32416] > >Hi Tom, > Thanks for the quick reply. I am still confused though. > >I made a new modelj config file that did define 1-N relationships. It did >have performSaveExisting() in any of >the source generated. > >On the other hand, in the original sample.xml, it has role-user defined as >M-N. This did generate the >performSaveExisting() method, and in the comment it said "saves an User to >another bean in a many-to-many >relationship". > >Did you make a typo, or was it supposed to generate this for only M-N, and >not 1-N? Logically, you would want >this for 1-N (I know I do). > >Here is the relationship section of my modelj config file. I must be doing >something wrong in here=). > > >Thanks, >Eric > ><!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --> > <relationship> > <parent-bean-name>User</parent-bean-name> > <parent-multiplicity>One</parent-multiplicity> > <child-bean-name>UserInfo</child-bean-name> > <child-multiplicity>One</child-multiplicity> > <navigation>bidirectional</navigation> > </relationship> > <relationship> > <parent-bean-name>User</parent-bean-name> > <parent-multiplicity>One</parent-multiplicity> > <child-bean-name>Checkout</child-bean-name> > <child-multiplicity>Many</child-multiplicity> > <navigation>bidirectional</navigation> > </relationship> > <relationship> > <parent-bean-name>User</parent-bean-name> > <parent-multiplicity>One</parent-multiplicity> > <child-bean-name>Alert</child-bean-name> > <child-multiplicity>Many</child-multiplicity> > <navigation>bidirectional</navigation> > </relationship> > <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --> > <relationship> > <parent-bean-name>Alert</parent-bean-name> > <parent-multiplicity>One</parent-multiplicity> > <child-bean-name>Checkout</child-bean-name> > <child-multiplicity>One</child-multiplicity> > <navigation>bidirectional</navigation> > </relationship> > <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --> > <relationship> > <parent-bean-name>Box</parent-bean-name> > <parent-multiplicity>One</parent-multiplicity> > <child-bean-name>Checkout</child-bean-name> > <child-multiplicity>Many</child-multiplicity> > <navigation>bidirectional</navigation> > </relationship> > <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --> > > > > > > >-----Original Message----- >From: Tom Tessier >To: mod...@li... >Sent: 5/26/2003 9:40 PM >Subject: Re: [Modelj-user] Perform_Save_Existing > >Hi Eric, > >Actually, performSaveExisting is only called when you associate an >existing >object to another that contains it in a one-to-many relationship. So far > >example, when you have Role-Users one-to-many relationship, and >associate an >existing User to an existing Role, the performSaveExisting method of >Role >will be called. Currently, both objects in one-to-one relationships are >saved simulatenously to the database, regardlessly of whether one is >blank >or not. Any suggestions on why this shouldn't be so? > >Tom > > > >From: Eric Dunn <ed...@me...> > >To: "'mod...@li...'" > ><mod...@li...> > >Subject: [Modelj-user] Perform_Save_Existing > >Date: Mon, 26 May 2003 21:11:08 -0700 > >MIME-Version: 1.0 > >Received: from sc8-sf-list2.sourceforge.net ([66.35.250.206]) by > >mc9-f17.bay6.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 26 >May > >2003 21:10:13 -0700 > >Received: from sc8-sf-list1-b.sourceforge.net ([10.3.1.13] > >helo=sc8-sf-list1.sourceforge.net)by sc8-sf-list2.sourceforge.net with > >esmtp (Exim 3.31-VA-mm2 #1 (Debian))id 19KVnE-00082D-00; Mon, 26 May >2003 > >21:10:32 -0700 > >Received: from mail16.messagelabs.com ([64.124.170.131])by > >sc8-sf-list1.sourceforge.net with smtp (Exim 3.31-VA-mm2 #1 (Debian))id > > >19KVmI-0000Ic-00for <mod...@li...>; Mon, 26 May >2003 > >21:09:35 -0700 > >Received: (qmail 27930 invoked from network); 27 May 2003 04:01:16 >-0000 > >Received: from diquil.merc-int.com (HELO merc-int.com) (64.242.155.19) >by > >server-6.tower-16.messagelabs.com with SMTP; 27 May 2003 04:01:16 -0000 > >Received: from sunexbh01.merc-int.com (sunexbh01.merc-int.com > >[64.242.153.21])by merc-int.com (8.11.2/8.11.2) with ESMTP id > >h4R49V116957for <mod...@li...>; Mon, 26 May 2003 > >21:09:31 -0700 > >Received: by sunexbh01.merc-int.com with Internet Mail Service > >(5.5.2653.19)id <LD8Z8BZK>; Mon, 26 May 2003 21:09:31 -0700 > >X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP > >X-VirusChecked: Checked > >X-Env-Sender: ed...@me... > >X-Msg-Ref: server-6.tower-16.messagelabs.com!1054008076!504 > >Message-ID: > ><BA4...@sv...> > >X-Mailer: Internet Mail Service (5.5.2653.19) > >Sender: mod...@li... > >Errors-To: mod...@li... > >X-BeenThere: mod...@li... > >X-Mailman-Version: 2.0.9-sf.net > >Precedence: bulk > >List-Help: ><mailto:mod...@li...?subject=help> > >List-Post: <mailto:mod...@li...> > >List-Subscribe: > ><https://lists.sourceforge.net/lists/listinfo/modelj-user>,<mailto:mode >lj-...@li...?subject=subscribe> > >List-Id: <modelj-user.lists.sourceforge.net> > >List-Unsubscribe: > ><https://lists.sourceforge.net/lists/listinfo/modelj-user>,<mailto:mode >lj-...@li...?subject=unsubscribe> > >List-Archive: > ><http://sourceforge.net/mailarchive/forum.php?forum=modelj-user> > >Return-Path: mod...@li... > >X-OriginalArrivalTime: 27 May 2003 04:10:13.0100 (UTC) > >FILETIME=[DEFC02C0:01C32405] > > > >Hi guys, > > First I'd like to say I like your product's design and >appreciate > >its simplicity, and use of good design > >patterns. > > > > My problem is this, I noticed in your code in your struts action > > >classes, I have generated performSave > >methods. If this entity 'A' is involved in a relationship with 'B', the > > >generated code will always create a > >new 'B' row in the database, regardless if one exists or not. > > > > Now I took a look at your guys BaseAction class and saw the >contant > >for "PERFORM_SAVE_EXISTING". This is > >actually exactly what I want, but for some reason either, > > > >1) I have missed some flag in the sample.xml, or > >2) your code does not generate this method. > > > >How do I get this method to be generated? If it does not support this > >functionality I suppose I have to write > >it myself =). > > > >Thanks so much, > >Eric Dunn > > > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: ObjectStore. > >If flattening out C++ or Java code to make your application fit in a > >relational database is painful, don't do it! Check out ObjectStore. > >Now part of Progress Software. http://www.objectstore.net/sourceforge > >_______________________________________________ > >Modelj-user mailing list > >Mod...@li... > >https://lists.sourceforge.net/lists/listinfo/modelj-user > >_________________________________________________________________ >The new MSN 8: advanced junk mail protection and 2 months FREE* >http://join.msn.com/?page=features/junkmail > > > >------------------------------------------------------- >This SF.net email is sponsored by: ObjectStore. >If flattening out C++ or Java code to make your application fit in a >relational database is painful, don't do it! Check out ObjectStore. >Now part of Progress Software. http://www.objectstore.net/sourceforge >_______________________________________________ >Modelj-user mailing list >Mod...@li... >https://lists.sourceforge.net/lists/listinfo/modelj-user _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 |