First of all, thanks for creating this great application framework!
I have been trying to implement a DTO with an file "attachment" property. The purpose is to utilize the DownloadField to provide the uploading and downloading of files.
My first trial includes only a single file per DTO instance:
@Getter
@Setter
@Downloadable(propertyFileName="attachmentFileName"
private File attachment;
@Getter
@Setter
private String attachmentFileName;
With this, the upload works perfectly, but the dowload throws the following exception:
java.lang.RuntimeException: java.lang.ClassCastException: java.io.File cannot be cast to [B
Could you please provide an example how to define this in the correct way?
Furthermore, I continued to test with the possibility to upload multiple files. Instead of defining just a single file, I changed to property to an embedded CRUD property (OneToMany relationship to an own Attachment DTO).
@Getter
@Setter
@OneToMany(cascade=ALL, orphanRemoval=true)
@CrudField(embedded=true, forceRequired=false)
private Set<Attachment>
However, this shows only a CRUD table with all properties in the Attachment DTO, except for the file "attachment" itself.
An example for also getting this to work would be highly appreciated. Thanks, in advance!