db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Murphy <jim.mur...@pobox.com>
Subject Re: Generate primary key ids on insert?
Date Sat, 12 Jan 2008 16:11:39 GMT

Thanks Ryan I'm on it. I came to think that this is the simplest approach too
and appreciate your help!

Cheers,

Jim


Bryan Pendleton wrote:
> 
>> set.  I have NOT parked this calumn as auto incrementing since when the
>> db
>> is really in use the incrementing is done by hibernate 
> 
> If it's just a one-time-load scenario, then one possibility is:
> 
>   - Create a temporary table of the right structure, with the PK as
>     an autoincrementing identity column.
>   - Insert the data into that table.
>   - create the real table with the PK as a non-automatic column (to
>     be maintained by Hibernate)
>   - copy the data from the temp table to the real table using
>     INSERT ... SELECT ...
>   - drop the temp table and run with Hibernate.
> 
> thanks,
> 
> bryan
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Generate-primary-key-ids-on-insert--tp14775039p14775284.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message