commiting External files into object not working


I have a Object which has a value FileDescriptor List property.

        joinColumns = @JoinColumn(name = "DEVIATION_INPUT_ID"),
        inverseJoinColumns = @JoinColumn(name = "FILE_DESCRIPTOR_ID"))
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.


is successful then I’m doing

listOfPics.add(fd); //local param to distinguish freshly uploaded files with already existing

then in

protected boolean preCommit() {
    if (getItem().getPics() !=null) {
        for (FileDescriptor fd : listOfPics) {
    return  super.preCommit();

could you help me figure out what’s the problem there?

Resolved it.
Since it was a list of Files, so a table, in you editor you should have

protected Table<FileDescriptor> picsTable;

and populate pics when the file is uploaded to temporary repository with :


It will commit everything to External File once the you Custom Entity has been committed.


You are right. If you want to commit Many-to-Many relation instances with your main entity they must be added to datasource, because data sources track changes and pass data to middle ware on editor commit.

1 Like