Support for PostgreSQL UUID data type

Description

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

Environment

None

Activity

Show:
Steve Ebersole
June 1, 2010, 9:17 PM

David (et al), please give this a try (you'll need to grab the nightly build or build from source for the time being)

David Driscoll
June 12, 2010, 3:12 AM

I have been testing this, I will post my testing results and additional suggestions this weekend.

David Driscoll
June 14, 2010, 12:48 AM

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.

Steve Ebersole
June 14, 2010, 8:39 PM

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:

Steve Ebersole
June 14, 2010, 8:59 PM

Committed the binding change

Fixed

Assignee

Steve Ebersole

Reporter

Olivier Van Acker

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure