mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 05:57:57 +01:00
#451: update the file content with an Hibernate query instead of a native query
This commit is contained in:
parent
3ad0554a7d
commit
5e2a18f819
@ -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.
|
||||
*
|
||||
|
@ -114,7 +114,7 @@ public class FileProcessingAsyncListener {
|
||||
}
|
||||
|
||||
freshFile.setContent(content);
|
||||
fileDao.updateContent(freshFile);
|
||||
fileDao.update(freshFile);
|
||||
|
||||
// Update index with the updated file
|
||||
if (isFileCreated) {
|
||||
|
Loading…
Reference in New Issue
Block a user