You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by phillip rhodes <rh...@telerama.com> on 2002/09/11 06:46:35 UTC

manipulate id_table?

Hi.
Searched for 1 hour, but did not turn anything in the archive.

Is their any object oriented way to deal with the id_table, other than writing sql?

I need to update the id_table to have values that will not cause primary key violations.
I will get the max of each table prime key, and update the id table with max + 1;


Thanks.




RE: manipulate id_table?

Posted by Stephen Haberman <st...@chase3000.com>.
Ah, good catch. Thanks, Scott.

- Stephen

> -----Original Message-----
> From: Scott Eade [mailto:seade@backstagetech.com.au]
> Sent: Wednesday, September 11, 2002 12:17 AM
> To: turbine-user
> Subject: Re: manipulate id_table?
> 
> > From: "Stephen Haberman" <st...@chase3000.com>
> >
> > The id table schema is just like any other schema. You can feed it
> > through the Torque om generation and get the objects. Then use
Criteria
> > to select the max one, add one, and then call .save().
> 
> Not quite - you also need to deal with the id cache (perhaps just
setting
> database.ifbroker.cleverquantity to false may be enough - but this may
have
> performance implications).
> 
> Scott
> --
> Scott Eade
> Backstage Technologies Pty. Ltd.
> http://www.backstagetech.com.au
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: manipulate id_table?

Posted by Scott Eade <se...@backstagetech.com.au>.
> From: "Stephen Haberman" <st...@chase3000.com>
> 
> The id table schema is just like any other schema. You can feed it
> through the Torque om generation and get the objects. Then use Criteria
> to select the max one, add one, and then call .save().

Not quite - you also need to deal with the id cache (perhaps just setting
database.ifbroker.cleverquantity to false may be enough - but this may have
performance implications).

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: manipulate id_table?

Posted by Stephen Haberman <st...@chase3000.com>.
The id table schema is just like any other schema. You can feed it
through the Torque om generation and get the objects. Then use Criteria
to select the max one, add one, and then call .save().

- Stephen

> -----Original Message-----
> From: phillip rhodes [mailto:rhodespc@telerama.com]
> Sent: Tuesday, September 10, 2002 11:47 PM
> To: Turbine Users List
> Subject: manipulate id_table?
> 
> Hi.
> Searched for 1 hour, but did not turn anything in the archive.
> 
> Is their any object oriented way to deal with the id_table, other than
writing sql?
> 
> I need to update the id_table to have values that will not cause
primary key
> violations.
> I will get the max of each table prime key, and update the id table
with max + 1;
> 
> 
> Thanks.
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>