Hi,
I have a Object which has a value FileDescriptor List property.
@JoinTable(name = "EQUIPMENTCHECKLIST_DEVIATION_INPUT_FILE_DESCRIPTOR_LINK",
joinColumns = @JoinColumn(name = "DEVIATION_INPUT_ID"),
inverseJoinColumns = @JoinColumn(name = "FILE_DESCRIPTOR_ID"))
@ManyToMany
protected List<FileDescriptor> pics;
What I would like to do is update that list(which is a list of FileDescriptor when looking from the UI ) by uploading the file first into temporary rep. then commit it once the main Object is committed successfully.
The problem is that files are committed into External Files but not attached at the Object.
uploadField.addFileUploadSucceedListener
is successful then I’m doing
listOfPics.add(fd); //local param to distinguish freshly uploaded files with already existing
getItem().getPics().add(fd);
then in
@Override
protected boolean preCommit() {
if (getItem().getPics() !=null) {
for (FileDescriptor fd : listOfPics) {
getItem().getPics().add(dataSupplier.commit(fd));
}
}
return super.preCommit();
}
could you help me figure out what’s the problem there?