Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 16811554 authored by Joze RIHTARSIC's avatar Joze RIHTARSIC
Browse files

fix sql stream

parent 653a54a5
No related branches found
No related tags found
No related merge requests found
Pipeline #222534 failed
......@@ -217,11 +217,10 @@ public class DocumentDao extends BaseDao<DBDocument> {
TypedQuery<DBDocument> query = memEManager.createNamedQuery(QUERY_DOCUMENT_LIST_FOR_TARGET_DOCUMENT, DBDocument.class);
query.setParameter(PARAM_DOCUMENT_ID, document.getId());
// user stream ulink to capture audit record
try (Stream<DBDocument> streamDocument = query.getResultStream()) {
streamDocument.forEach(linkedDoc -> {
linkedDoc.setReferenceDocument(null);
});
}
List<DBDocument> lstDocuments = query.getResultList();
lstDocuments.forEach(linkedDoc -> {
linkedDoc.setReferenceDocument(null);
});
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment