[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3579?page=c...
]
Steve Ebersole commented on HHH-3579:
-------------------------------------
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:
{code}
Configuration cfg = ...;
cfg.registerTypeOverride(
/*
* Create a new PostgresUUIDType instance in order to register it as the default
mapping for java.util.UUID.
*
* The other option is to manually specify to use this type for all UUID fields.
*/
new org.hibernate.type.PostgresUUIDType() {
protected boolean registerUnderJavaType() {
return true;
}
}
);
{code}
Support for PostgreSQL UUID data type
-------------------------------------
Key: HHH-3579
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3579
Project: Hibernate Core
Issue Type: New Feature
Components: core
Affects Versions: 3.3.1
Reporter: Olivier Van Acker
Assignee: Steve Ebersole
Fix For: 3.6
Attachments: patch_HH_3579_Hibernate.txt, patch_HH_3579_NullableType.txt,
patch_HH_3579_PostgresSQLDialect.txt, patch_HH_3579_TypeFactory.txt,
patch_HH_3579_UuidType.txt, postgresuuidType20100613.patch
Time Spent: 6.45h
Remaining Estimate: 0h
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
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira