I am using ISIS 1.16.2 for a project at work and struggling with attachments and some related issues. I hope, you can help me (at least for a subset of my issues).
Context: My item classes need to store an arbitrary number of attachments (Blobs and/or Clobs).
From the example for one attachment:
@Persistent(defaultFetchGroup = "false",
columns = { @Column(name = "attachment_name"),
@Column(name = "attachment_mimetype"),
@Column(name = "attachment_bytes",
jdbcType = "BLOB",
sqlType = "LONGVARBINARY")
})
@Column(allowsNull = "true")
private Blob attachment;
First approach for multiple attachments:
@javax.jdo.annotations.Persistent(???)
@org.apache.isis.applib.annotation.Property(
domainEvent = AttachmentDomainEvent.class,
optionality = Optionality.OPTIONAL,
hidden = Where.ALL_TABLES)
@org.apache.isis.applib.annotation.Collection
@lombok.Getter
private List<Blob> attachments = new LinkedList<>();
- Question: How do I have to annotate this field so that the elements of this list are stored in a self-contained table instead of being serialized into a single column of the containing object? Unfortunately I am not yet familiar with these annotations for nested types.
- Question:
Can ISIS handle multiple file uploads simultaneously? For example as an action:
@Action public void uploadFiles(List<Blob> files) {...}
- Question: Is it possible with ISIS 1.16.2 (or future versions) to store some meta information with the Blob/Clob entries (for example size, owner etc.) in a dedicated table without loosing the capability of ISIS/Wicket to show a download button, a preview etc. for a custom extended BLOB class?
Maybe a bit off-topic but related to the problem above:
- Question: With the collection property
List<Blob> attachments;
(see above), I get??? EntityModel objectAdapter oid: null
for each attachment in the table because the Blob/Clob classes are value types instead of reference types. What is the "right" way to provide the necessary information to render these value types correctly? (I have the same issue with enum sets)
Thanks in advance!