PostgreSQL has since version 8.3 UUID as data type nativly supported in the database.
The only way to get this to work in Hibernate is to add <column name="id" sql-type="uuid"/> to your mappings file (or @columnDefinition via annotations)
and create your own custom usertype (e.g. public class UUIDUserType implements UserType, Serializable {..} ) and map this to java.util.UUID
worth mentioning is that java.util.UUID is only introduced in java 1.5 so there might be a backwards compatibility problem
David (et al), please give this a try (you'll need to grab the nightly build or build from source for the time being)
I have been testing this, I will post my testing results and additional suggestions this weekend.
I successfully ran thru some tests with just 2 changes:
set registerUnderJavaType to true, and needed to use a different setObject overload in method: getBinder().
I will attach a small patch file.
I just forgot the binding change. That I can accept.
The other, not so much. The intention though is that your code can do this:
Committed the binding change