openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <>
Subject UUID generators worth the effort?
Date Mon, 04 Apr 2016 08:49:21 GMT
Hi all,
in Syncope we are currently discussing [1] the option to replace our 
table generators-based id strategy to something else, based on UUID, 
which seem to offer several advantages.

I have found [2], but I would rather prefer to generated UUID values 
manually (via [3] which seems to offer better performance and more 
features than the standard JDK's).

In order to do so, I would replace the current

     private Long id;

     public Long getKey() {
         return id;

in  [4], backed by [5], with something like as

private UUID id;

public UUID getKey() {
   synchronized(this) {
     if (key == null) {
       key = ... // generate via JUG [3]
   return key;

As Syncope supports several DBMSes, I would also like to empower the 
underlying capabilities for storing such values:

  * UUID Type for PostgreSQL [6]
  * RAW(16) for Oracle [8]
  * BINARY(16) with some optimizations for MySQL / MariaDB [9] or 
vanilla with H2

Do you have any suggestion about:

  (a) the way how I am planning to support UUID generation
  (b) the cleanest way to support DBMS differences (extending the 
respective DB dictionaries?)



Francesco Chicchiriccò

Tirasa - Open Source Excellence

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC, CXF committer

View raw message