Merge 4a91238cc2
into fb7571185a
This commit is contained in:
commit
061261068f
|
@ -0,0 +1,3 @@
|
|||
type: fix
|
||||
issue: 6199
|
||||
title: "Fix for an mssql runtime error when searching for resources with the _include clause."
|
|
@ -115,6 +115,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.hibernate.dialect.SQLServerDialect;
|
||||
import org.hl7.fhir.instance.model.api.IAnyResource;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -1584,6 +1585,10 @@ public class SearchBuilder implements ISearchBuilder<JpaPid> {
|
|||
|
||||
String sql = localReferenceQuery + " UNION " + canonicalQuery.getLeft();
|
||||
|
||||
if (myDialectProvider.getDialect() instanceof SQLServerDialect) {
|
||||
sql += " order by r." + findPidFieldSqlColumn;
|
||||
}
|
||||
|
||||
List<Collection<JpaPid>> partitions = partition(nextRoundMatches, getMaximumPageSize());
|
||||
for (Collection<JpaPid> nextPartition : partitions) {
|
||||
Query q = entityManager.createNativeQuery(sql, Tuple.class);
|
||||
|
|
Loading…
Reference in New Issue