This commit is contained in:
Michael Buckley 2024-04-04 15:32:35 -04:00
parent 6958f0eb43
commit a944c18a38

View File

@ -199,16 +199,12 @@ public abstract class BaseHapiFhirSystemDao<T extends IBaseBundle, MT> extends B
if (ids.size() >= 2) { if (ids.size() >= 2) {
List<ResourceTable> loadedResourceTableEntries = new ArrayList<>(); List<ResourceTable> loadedResourceTableEntries = new ArrayList<>();
new QueryChunker<Long>() new QueryChunker<Long>().chunk(ids, nextChunk -> {
.chunk(
ids,
nextChunk -> {
// List<ResourceTable> allById = myResourceTableDao.findAllById(nextChunk); // List<ResourceTable> allById = myResourceTableDao.findAllById(nextChunk);
Query query = myEntityManager.createQuery( Query query = myEntityManager.createQuery("select r, h FROM ResourceTable r "
"select r, h FROM ResourceTable r " + + " LEFT JOIN fetch ResourceHistoryTable h on r.myVersion = h.myResourceVersion and r.id = h.myResourceId"
" LEFT JOIN fetch ResourceHistoryTable h on r.myVersion = h.myResourceVersion and r.id = h.myResourceId" + + " left join fetch h.myProvenance"
" left join fetch h.myProvenance" + + " WHERE r.myId IN ( :IDS )");
" WHERE r.myId IN ( :IDS )");
query.setParameter("IDS", ids); query.setParameter("IDS", ids);
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")