[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3579) Support for PostgreSQL UUID data type

Steve Ebersole (JIRA) noreply at atlassian.com
Mon May 24 08:46:55 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37262#action_37262 ] 

Steve Ebersole commented on HHH-3579:
-------------------------------------

mapping it to OTHER is an issue when doing schema export.  The way your classes are right now, any Type reporting OTHER As it's SQL type will be created as UUID.  Really OTHER is worthless in terms of export so in that sense it's arguable to go ahead and allow it.  My preference though is that whenever we are talking about a specific database datatype we use the type code given that datatype by the database vendor.

That being said, I think (1) the code constant should go on the dialect (this is all specific to postgresql after all) and (2) we will need 2 types (one specific to postgresql and mapping to it's uuid datatype, another generic one mapping to char)

> 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
>
>
> 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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list