#451: update the file content with an Hibernate query instead of a native query

This commit is contained in:
bgamard 2020-09-10 20:42:51 +02:00
parent 3ad0554a7d
commit 5e2a18f819
2 changed files with 1 additions and 9 deletions

View File

@ -154,14 +154,6 @@ public class FileDao {
return file;
}
public void updateContent(File file) {
EntityManager em = ThreadLocalContext.get().getEntityManager();
Query query = em.createNativeQuery("update T_FILE f set FIL_CONTENT_C = :content where f.FIL_ID_C = :id");
query.setParameter("content", file.getContent());
query.setParameter("id", file.getId());
query.executeUpdate();
}
/**
* Gets a file by its ID.
*

View File

@ -114,7 +114,7 @@ public class FileProcessingAsyncListener {
}
freshFile.setContent(content);
fileDao.updateContent(freshFile);
fileDao.update(freshFile);
// Update index with the updated file
if (isFileCreated) {