Hello,
I have this property in my hibernate .hbm.xml file, and it works ok:
<property name="name" type="string" index="name"/>
However, this one fails (when using Mysql):
<property name="name" type="text" index="name"/>
with:
16:03:00,013 ERROR SchemaExport:274 - Unsuccessful: create index sourceId on Item (sourceId)
16:03:00,013 ERROR SchemaExport:275 - BLOB/TEXT column 'sourceId' used in key specification without a key length
That is, with MySql you need to specify a length for a text column.
How can I specify a key length in the Hibernate file?
I've tried:
<property name="name" type="text" index="name(255)"/>
<property name="name" type="text" index="name" length="255"/>
but that's not valid syntax.
How can I specify a key length in the Hibernate file?
Many thanks,
DAvid
|