I assume this property needs to be unique (this is stated in its JavaDocs, though there is no unique constraint declared in the mapping file?). If so, you maybe could condense your token to something much shorter which still is unique? Either somehow "semantically" or e.g. using a SHA-1 hash? I don't know the use case, but 4096 characters seems very much for ensuring uniqueness. As per this [SO answer ]( | http://dba.stackexchange.com/questions/49913/specified-key-was-too-long-max-key-length-is-1000-bytes-in-mysql-5-6 ) ] you can configure a max index key length up to 3072 characters. But even that seems quite a lot.
|