From 5a450227b240de0dd8e4559f995999cac99beded Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Sat, 18 Jul 2015 17:05:10 -0400 Subject: [PATCH] Fix unit test issues --- .../main/java/ca/uhn/fhir/rest/server/RestfulServer.java | 2 +- .../java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index 6288f75df04..77faf38ff52 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -725,7 +725,7 @@ public class RestfulServer extends HttpServlet { BaseServerResponseException exception = null; for (int i = getInterceptors().size() - 1; i >= 0; i--) { IServerInterceptor next = getInterceptors().get(i); - exception = next.preProcessOutgoingException(requestDetails, exception, theRequest); + exception = next.preProcessOutgoingException(requestDetails, e, theRequest); if (exception != null) { ourLog.debug("Interceptor {} returned false, not continuing processing"); break; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index a8cb8718db5..1912d830166 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -1096,7 +1096,12 @@ public abstract class BaseHapiFhirResourceDao extends BaseH } From stringJoin = theFrom.join(joinAttrName, JoinType.INNER); - thePredicates.add(theBuilder.equal(stringJoin.get("myParamName"), theSort.getParamName())); + + if (param.getParamType() == RestSearchParameterTypeEnum.REFERENCE) { + thePredicates.add(stringJoin.get("mySourcePath").as(String.class).in(param.getPathsSplit())); + } else { + thePredicates.add(theBuilder.equal(stringJoin.get("myParamName"), theSort.getParamName())); + } // Predicate p = theBuilder.equal(stringJoin.get("myParamName"), theSort.getParamName()); // Predicate pn = theBuilder.isNull(stringJoin.get("myParamName"));