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