This commit is contained in:
Michael Buckley 2024-04-04 15:32:35 -04:00
parent 6958f0eb43
commit a944c18a38
1 changed files with 43 additions and 47 deletions

View File

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