[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6801) UUIDBinaryType generates column of type BINARY(255) instead of BINARY(16) in MySQL

Steve Ebersole (JIRA) noreply at atlassian.com
Tue May 1 20:00:50 EDT 2012


    [ https://hibernate.onjira.com/browse/HHH-6801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46472#comment-46472 ] 

Steve Ebersole commented on HHH-6801:
-------------------------------------

This wont really be addressable until 5.0.  The problem is that currently types have no input into sql typing.  See HHH-6045

The workaround is to specify the column length in your mapping:
{code}
<property access="field" name="uuid" not-null="true" type="uuid-binary">
   <column name="MI_UUID" length="16" not-null="true"/>
</property>
{code}

> UUIDBinaryType generates column of type BINARY(255) instead of BINARY(16) in MySQL
> ----------------------------------------------------------------------------------
>
>                 Key: HHH-6801
>                 URL: https://hibernate.onjira.com/browse/HHH-6801
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.6.8
>         Environment: MySQL 5.1 InnoDB
> Custom dialect (see HHH-6800)
>            Reporter: Artem Gelun
>
> Property definition:
> {code:xml}
> <property access="field" name="uuid" not-null="true" type="uuid-binary">
>    <column name="MI_UUID" not-null="true"/>
> </property>
> {code}
> Debug:
> {code}
> 00:13:35,312 DEBUG SchemaExport:415 - create table PCS_MI (MI_CONTAINER bigint not null, MI_ID integer not null, MI_CODE varchar(255), MI_NAME varchar(255), MI_DESCRIPTION varchar(255), MI_TYPE bigint, MI_STATE_CALC_RULE varchar(255), MI_STATE_DICT bigint, MI_EMERG_CALC_RULE varchar(255), MI_ISACTIVE bit default true not null, MI_PARENT_CONTAINER bigint, MI_PARENT_ID integer, MI_UUID binary(255) not null, primary key (MI_CONTAINER, MI_ID)) ENGINE=InnoDB
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list