How to create a BLOB column for a List<byte[]>


claudio_rosati@...
 

Hello all,

I a persisted class I have the following two instance variables:

  private List<File> referenceFiles = new ArrayList<>();
  private List<byte[]> referenceFilesContent = new ArrayList<>();

where the first is keeping the file paths as File objects, and the second their content. The problem here is that the content can be large (image, for example) and when the DB is created the content column is a LONGVARBINARY with a DB type of LONG VARCHAR FOR BIT DATA, whose unchangeable length is 32700 bytes.

I've tried adding @Column(jdbcType = "BLOB") on the referenceFilesContent variable (and then @Column(jdbcType = "BLOB", sqlType = "BLOB")) but nothing changed (I'm using DataNucleus 6.0.0-m1 on a Derby java DB).

How can solve this issue?

Join main@datanucleus.groups.io to automatically receive all group messages.