I'm using JPA2 with hibernate 3.6.1. and a Derby database and I used the following annotation for a blob:
@Column(length = Integer.MAX_VALUE)
@Lob
long[] bucket;
Hibernate creates the correct blob column but if I try to save an entity I get the following exception:
java.lang.ClassCastException: [J cannot be cast to java.sql.Blob
why and how can I make this work?
If I annotate it without the @Lob I get a "Varchar for bit data" column which can only contain up to 32m.