From d838a2bd4bc3d0dfac4f89167c0de827b6f6bcdf Mon Sep 17 00:00:00 2001 From: James Agnew Date: Wed, 21 Oct 2015 10:37:56 -0400 Subject: [PATCH] Reduce JPA uri param length from 256 to 255 to accomodate MySql --- .../fhir/jpa/entity/ResourceIndexedSearchParamString.java | 3 +++ .../uhn/fhir/jpa/entity/ResourceIndexedSearchParamUri.java | 5 ++++- src/changes/changes.xml | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java index 11bf98d28dd..2dfdafc63a7 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java @@ -43,6 +43,9 @@ import org.hibernate.search.annotations.Field; }) public class ResourceIndexedSearchParamString extends BaseResourceIndexedSearchParam { + /* + * Note that MYSQL chokes on unique indexes for lengths > 255 so be careful here + */ public static final int MAX_LENGTH = 200; private static final long serialVersionUID = 1L; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamUri.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamUri.java index 5e3adeca952..6fa9351f7ef 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamUri.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamUri.java @@ -43,7 +43,10 @@ import org.hibernate.search.annotations.Indexed; //@formatter:on public class ResourceIndexedSearchParamUri extends BaseResourceIndexedSearchParam { - public static final int MAX_LENGTH = 256; + /* + * Note that MYSQL chokes on unique indexes for lengths > 255 so be careful here + */ + public static final int MAX_LENGTH = 255; private static final long serialVersionUID = 1L; diff --git a/src/changes/changes.xml b/src/changes/changes.xml index eb45d185f1d..e1c585f60d6 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -188,6 +188,10 @@ by calling the actual implementing method in the server (previously the call was simulated, which meant that many features did not work) + + JPA server maximumn length for a URI search parameter has been reduced from + 256 to 255 in order to accomodate MySQL's indexing requirements +