11

I have a file as a byte[] fileContent. My mySql-scheme is generated by Hibernate and by default hibernate sets the sql-type of fileContent to BLOB.

But a BLOB is not big enough for my files. I will need at least a MEDIUMBLOM or even a LONGBLOB.

But how can i annotate my field so that Hibernate will generate the scheme with my field as a LONGBLOB? I have search google for 2 hours now without getting anything...

Shouldn't this be a so simple and common task that it should be documented somewhere??

Please help a frustrated programmer!!

@WhatAnnotationCanIUseToForceHibernateToMakeThisALONGBLOB????
private byte[] fileContent;
user829237
  • 1,719
  • 8
  • 37
  • 61

1 Answers1

31

Have you tried

@Column(columnDefinition = "LONGBLOB")
private byte[] fileContent; 
axtavt
  • 239,438
  • 41
  • 511
  • 482