Thanks!  That looks like it'll do it easily enough.  Too bad
there's not a quick way to specify the table name, but what
seems easy at the top level often times isn't so easy in the
implementation.

Anyway, I'll try that, and thanks again.
-jeff

----- Original Message -----
From: "Jean-Marc Lavoie" <[EMAIL PROTECTED]>
To: "Turbine Torque Users List" <[EMAIL PROTECTED]>
Sent: Thursday, October 03, 2002 6:17 AM
Subject: Re: Save an object to a different table name


> As you have 2 identical tables, you probably have 2 close to identical
> base and generated object. In your Base object,  there is a (protected)
> copyinto(... ) method, you can grab it and copy it to your other object,
> and make it public. You will then have two different copyInto method
> (one public, and one protected in the base object), one for each type of
> object you have.  It will work since the object are almost  method for
> method compatible.
>
> Then  saving to both table would be as simple as
> ObjectB objectB = new ObjectB;
> objectA.copyInto(objectB);
> objectA.save();
> objectB.save();
>
> You may also want to put that code in one method that save to both tables.
>
> Jeff Owens wrote:
>
> >I have created some objects using the TDK that go through 2 different
> >states.  Instead of having a "STATE" field, I have defined 2 identical
> >tables in the same database - in the long run its about a jillion times
> >easier for me to do it this way - just take my word for it.
> >
> >I would like to know if there's an easy way to save the same object to 2
> >different table names (again, the tables are identical).  In looking in
the
> >base object peer, there is a TABLE_NAME string - but it's final.  I've
also
> >looked at the map builder object, but that makes me think this is even
more
> >hopeless.  I've searched through my message archive, and the torque
> >documentation - I'm not even sure what to look for, truth be told.
> >
> >If someone knows how to go about this, I would very much appreciate it.
> >Thanks!
> >-jeff
> >
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to