db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: Generate primary key ids on insert?
Date Sat, 12 Jan 2008 15:56:32 GMT
> 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.



View raw message