[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3243) VARBINARY primary key with mysql doesn't function
Marc Ewert (JIRA)
noreply at atlassian.com
Thu Apr 17 04:59:34 EDT 2008
VARBINARY primary key with mysql doesn't function
-------------------------------------------------
Key: HHH-3243
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3243
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.1
Environment: MySQL-5.0.51a, hibernate-3.2.1.ga
Reporter: Marc Ewert
We have a 16-byte UUID type, which should be persisted in a VARBINARY (tinyblob) in a mysql database. But the primary key statement is invalid for mysql:
ERROR 11:34:13 [main] (SchemaExport.java:create:274) -
Unsuccessful:
create table T_GRI_USER (C_ID tinyblob not null, C_ATTRIBUTES
text, C_VERSION integer, C_PASSWORD varchar(255), C_VISIBILITIES
blob, C_STATE integer not null, C_LOGIN varchar(255) not null
unique, C_EMAIL varchar(255), primary key (C_ID))
ERROR 11:34:13 [main] (SchemaExport.java:create:275) - BLOB/TEXT
column 'C_ID' used in key specification without a key length
The statement should end with ... primary key (C_ID({length})). This has to be done in the class PrimaryKey, which forms this part of the statement without involving the Dialect.
The MySQLDialect has also a little bug, it doesn't write the length while defining the tinyblob column. But unfortunately this doesn't solve the SQL-Error. Unfortunately because the dialect is much better patchable for us as the PrimaryKey class deep in hibernate is...
--
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