Groovy domain mapping
255 is the default size provided to a byte[]. Specify the max size for report in constraints as per your requirement. Something like:
static constraints = { report(maxSize: 50000000)}
Based on max size, the field type in DB will be set. (mediumblob, longblob etc.)
Try explicitly setting the type to either a 'blob' or 'binary', for example you can add the following to the domain class:
static mapping = { report type:'blob'}
Here's a blog article that promises to solve this problem. The trick seems to be to have a field of type java.sql.Blob
, with the byte[]
field derived from that and marked as transient.