Return-Path: Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 42224 invoked from network); 19 Feb 2003 15:15:07 -0000 Received: from unknown (HELO natmail.tfanet.org) (63.122.113.131) by daedalus.apache.org with SMTP; 19 Feb 2003 15:15:07 -0000 thread-index: AcLYKa+SKhP/sahJRdi5T3m55HwpgA== Received: from [192.168.2.19] ([192.168.36.85]) by natmail.tfanet.org with Microsoft SMTPSVC(5.0.2195.5329); Wed, 19 Feb 2003 10:15:07 -0500 Subject: Re: how to generate removeObject() methods? (was: AW: how to tellthe bo that a foreign collection must be reloaded?) Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 From: "Peter S. Hamlen" To: "Turbine Torque Users List" In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Ximian Evolution 1.0.8 Date: 19 Feb 2003 10:16:31 -0500 Message-ID: <1045667791.16440.7060.camel@chimayblue.tfanet.org> MIME-Version: 1.0 X-OriginalArrivalTime: 19 Feb 2003 15:15:07.0051 (UTC) FILETIME=[AF9017B0:01C2D829] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N My mistake. That's not in the regular Torque templates. You can look at my previous post for more information. -Peter On Wed, 2003-02-19 at 09:46, Marc Lustig wrote: > Also, my torque-generated user objects don't have any removeObject() > methods. (addObject()'s are available). > Why is that? >=20 > torque.complexObjectModel=3Dtrue >=20 >=20 > > -----Urspr=FCngliche Nachricht----- > > Von: Peter S. Hamlen [mailto:phamlen@mail.com] > > Gesendet: Dienstag, 18. Februar 2003 19:39 > > An: Turbine Torque Users List > > Betreff: Re: how to tell the bo that a foreign collection must be > > reloaded? > > > > > > Well, depending on what you're doing, there are several answers: > > > > 1) If you get the foreign object from the collObjects list, then you > > don't need to do anything (because the object is still in the list and > > has been changed in place.) > > > > 2) If you're adding or removing foreign objects, then you may need to > > reload the list. > > a) The easiest way is to use the addObject() and removeObject() > > methods in the user object. This automatically adds/removes the foreig= n > > object from the collObjects list and no reload is necessary. > > b) In the cases where (for whatever reason) you can't use the > > addObject and removeObject functions, you may need to alter the base > > Template that generates your classes. We added a "clearCollection" > > function to all our obejcts that clears these collObjects. (I realize > > this means altering the templates which people may not feel like doing.= ) > > > > Hope this helps. > > -Peter > > > > On Sat, 2003-02-15 at 18:12, Marc Lustig wrote: > > > Hi, > > > I have related an attribute of the user over the foreign key. > > > The foreign objects are stored in the collObjects List. > > > After I changed one of the related objects, what is the proper > > way to tell > > > my user object that this object-collection needs to be updated (reloa= ded > > > from db)? > > > Problem is even if I call user.getObjects(new Criteria()) this > > doesn't make > > > sure that the collection will be reloaded since the last > > request might also > > > have used an empty criteria. > > > Idea? > > > > > > Marc > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > > > For additional commands, e-mail: torque-user-help@db.apache.org > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > > For additional commands, e-mail: torque-user-help@db.apache.org > > >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org >=20