John Smith
John Smith

Reputation: 752

OrmLite DataType.BYTE_ARRAY Data too long for column

I am struggling with inserting a blob, using MySQL. I notice ORMLite creates the corresponding column with DataType BLOB, while I require a LONGBLOB, since I get an exception thrown telling me

Data too long for column

I annotate the column:

@DatabaseField(dataType = DataType.BYTE_ARRAY)

What options are left, besides running a rawQuery when creating the table?

Upvotes: 0

Views: 333

Answers (1)

John Smith
John Smith

Reputation: 752

Oh ok, I got this. I have to add the following:

@DatabaseField(dataType = DataType.BYTE_ARRAY, columnDefinition = "LONGBLOB")

Upvotes: 1

Related Questions