Commit 4bbd114b authored by Maxym Borodenko's avatar Maxym Borodenko

Fix: Added lazy loading of RepositoryFile's for CropAttach

parent e3f7c5f3
......@@ -115,7 +115,13 @@ public class CropServiceImpl extends FilteredCRUDServiceImpl<Crop, CropFilter, C
crop = this.reload(crop);
// initialize lazy data
Hibernate.initialize(crop.getAttachments());
if (crop.getAttachments() != null) {
crop.getAttachments().size();
crop.getAttachments().forEach(a -> {
if (a.getRepositoryFile() != null)
a.getRepositoryFile().getId();
});
}
CropDetails cropDetails = new CropDetails();
cropDetails.crop = crop;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment