Right,
So what is saved in the TableGenerator Table is the next start level.
This means that when exporting a database from one database server to another there will be a jump in IDs (a maximum jump of allocationSize).
It would be nice if JPA could synchronize the in-memory counter with the table using it on server startup / application redeploy so that the IDs would be in line...
To do this the TableGenerator table would have to know the table(s) and column(s) it is used by...
The TableGenerator table would then look something like:
seq_name | seq_count | owner_table_tablename | owner_table_columnname
When initiating the in-memory counter the maxvalue of the "owner_table_columnname" would then be read as reference for the preceding generated values.
How about that as a JPA extension!?
-The SlingBlade
[Message sent by forum member 'slingblade' (slingblade)]
http://forums.java.net/jive/thread.jspa?messageID=263551