Hibernate 3.0.5, Spring 1.2.8, Oracle 9i.
In my app, I think I need two different kinds of id generators. I have a couple of tables where all the content is generated while the app is running. For these, I'll use a normal sequence. These two tables will continue to accumulate rows while the application is running.
However, I have several tables (most of them, actually), whose data is initialized into the database before the application starts. In the present script, I hardcode incrementing OID values into each row. After the application starts up, however, a small number of rows may be added to these tables. This will happen very rarely, but it will happen.
If I define a plain sequence for the latter tables, I would have to hardcode the starting value for the sequence for that table, to ensure that new rows added to the table(s) use a unique sequence value.
Would I be better off just defining a trigger to set the OID, so my initialization data wouldn't need to hardcode the OID, and I could use plain sequences all around?
|