Skip to Content.
Sympa Menu

grouper-dev - reducing the uuid/id pair to identify a row in grouper tables

Subject: Grouper Developers Forum

List archive

reducing the uuid/id pair to identify a row in grouper tables

Chronological Thread 
  • From: Chris Hyzer <>
  • To: "" <>
  • Subject: reducing the uuid/id pair to identify a row in grouper tables
  • Date: Wed, 30 Jul 2008 03:06:56 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US



This issue we have been discussing is resolved:


Change log:


To upgrade, get a version of grouper that is 1.4+, and build 7/30/8.  Then start grouper or do an: ant schemaexport.  This will generate a script.  You should review it before running it.  It will create hibernate_version_number cols, and init them in all tables.  Also it will create old_id and old_uuid cols, and copy data from id and uuid there.  Then it will set the id to col to be the value of the uuid.  Then it will drop the uuid col.  When you are satisfied that everything is ok, you should set the ddlutils.dropBackupUuidCols to true, and the next time you schemaexport it will drop the old_id and old_uuid cols.


I have unit tests for the conversion, and they work fine in oracle and mysql.  Postgres is thorny with ddlutils unfortunately, so the generated scripts will need to be reviewed and edited.  I have been making progress with postgres, and will pick it up again so it will be smooth, but my timebox is done and I will move on to other things…


Btw, as part of this, the ID’s are the grouper assigned uuids (not hibernate’s), but a new col was needed for versioning to see if insert or update.  This col can also be used for optimistic locking if we want to make sure multiple processes don’t step on each others toes (we can just change something in the config, or possibly do it with hibernate metadata on the fly if people want to turn it on or off at will… we can try).  Fyi


One slightly non-standard thing is that the java uuid field maps to the db “id” col.  This is because it is hard to rename a primary key, so we need to key the db id col.  And since uuid is used in java, I opted to keep that.  We can refactor in java at some point if we like.


I added a way to put test values in the for unit testing:


    ApiConfig.testConfig.put("ddlutils.dropBackupUuidCols", "false");


All ddlutils scripts will start with dropping all foreign keys, and end with adding back




Archive powered by MHonArc 2.6.16.

Top of Page