diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java index c84b00900c5..e9e4e820bb1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java @@ -20,6 +20,8 @@ package ca.uhn.fhir.rest.param; * #L% */ +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; @@ -217,6 +219,22 @@ public class ParameterUtil { return b.toString(); } + /** + * Escapes a string according to the rules for parameter escaping specified in the FHIR Specification Escaping + * Section + */ + public static String escapeAndUrlEncode(String theValue) { + if (theValue == null) { + return null; + } + + try { + return URLEncoder.encode(escape(theValue), "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new Error("UTF-8 not supported on this platform"); + } + } + /** * Unescapes a string according to the rules for parameter escaping specified in the FHIR Specification Escaping * Section diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java index 3f8eba5fdb6..6f9b45405c2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java @@ -123,7 +123,8 @@ public abstract class BaseFhirDao implements IDao { private FhirContext myContext; - @PersistenceContext(name = "FHIR_UT", type = PersistenceContextType.TRANSACTION, unitName = "FHIR_UT") +// @PersistenceContext(name = "FHIR_UT", type = PersistenceContextType.TRANSACTION, unitName = "FHIR_UT") + @PersistenceContext(type = PersistenceContextType.TRANSACTION) private EntityManager myEntityManager; private List myListeners = new ArrayList(); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirResourceDao.java index e86e0f6611b..935df209c6d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirResourceDao.java @@ -39,6 +39,7 @@ import java.util.Set; import javax.annotation.PostConstruct; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; +import javax.persistence.PersistenceContextType; import javax.persistence.TemporalType; import javax.persistence.Tuple; import javax.persistence.TypedQuery; @@ -129,7 +130,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseFhirResourceDao.class); - @PersistenceContext() + @PersistenceContext(type = PersistenceContextType.TRANSACTION) private EntityManager myEntityManager; @Autowired diff --git a/pom.xml b/pom.xml index c35ab4ecb0e..3aeb055ac5c 100644 --- a/pom.xml +++ b/pom.xml @@ -202,7 +202,7 @@ UTF-8 3.1.0 1.7.10 - 4.1.5.RELEASE + 4.1.6.RELEASE 3.2.4.RELEASE 2.1.4.RELEASE 1.0.1