Hi,
I've created a user type for Types.VARBINARY. I'm mapping to MySQL5 using annotations:
Code:
@Id
@Column(name = "ID", length = 16)
@GeneratedValue(generator = "uuid")
@Type(type = "sample.UUIDType")
@GenericGenerator(name = "uuid", strategy = "sample.UUIDGenerator")
private UUID uuid;
In persistence.xml:
Code:
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
It works fine with HSQLDB but in MySQL it maps it to a tinyblob instead of a byte[] or raw. Here's the trace:
Code:
create table BOOKS (ID tinyblob not null, primary key (ID))
And MySQL complains:
Code:
BLOB/TEXT column 'ID' used in key specification without a key length
Even though it has been defined with length 16. Can I make this work (using just annotations preferably)?
Regards,