[hibernate-dev] UUID as id

Steve Ebersole steve at hibernate.org
Fri Jul 17 16:31:38 EDT 2015


This goes to the feature we just added in 5.0 of supporting "non standard"
types as identifiers.  Specifically UUID.

Sanne and I have been discussing the MySQL (MariaDB) tests hanging
recently.  Well on the ORM side this was caused by an overly optimistic
tests not properly handling transactions and connections on an exception.

The underlying exception however comes from this support running against
MySQL.  The UUID is treated as BINARY.  The test inserts a row, and then
deletes it by id.  The row is inserted no problem.  However the delete by
id fails.  Apparently MySQL is not liking comparisons using = based on
binary data.

The work around is to explicitly add @Column( length = 16 ).  This is
planned to be addressed later via org.hibernate.type.Type#dictatedSizes

Just a heads up if ya'll run into this.  I added a note to the migration
guide as well.


More information about the hibernate-dev mailing list