openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Nine <t...@spidertracks.com>
Subject Using a time UUID as a sequence
Date Wed, 19 Mar 2014 05:10:13 GMT
Hi all,
 We're migrating from a Key/Value system to MySQL for some components of
our system for easier administration and maintenance.  As part of this
migration, we need to retain the time UUIDs that have been generated for
primary keys.  I'm having a hard time mapping this.  I have the following.

@Id
@Column( columnDefinition = "BINARY(16)", length = 16 )
private UUID id;

However this always seems to fail.  I'm on the latest MySQL version 5.6.16
GA and Open JPA 2.2.2 I've found this old thread, but it's not quite what
I'm looking for.  I'm really struggling to find the documentation on how to
declare and implement custom type converters. Converting a UUID to a binary
array of length 16 is trivial, as is creating a new UUID instance from
those bytes.  I'm just not sure how to plug in to the JPA framework to make
it happen.  Any advice would be greatly appreciated.

Thanks,
Todd

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message