RepositoryFile with many Attach
AttachmentAspect
takes care of removing the RepositoryFile
from the repository when any ...Attach
entity is removed.
There is a possibility that the same RepositoryFile
is referenced by multiple ...Attach
entities. In that case, deleting one attachment must not (cannot) remove the file from the repository as it is still referenced.
Please ensure that when two or more ...Attach
refer to the same file, and one of them is removed, the file and one of the Attach
remain in the database. When the last Attach
is removed, the file must be removed.