You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by ks...@apache.org on 2014/01/22 15:36:16 UTC

svn commit: r1560361 - in /juddi/trunk: juddi-client/src/main/java/org/apache/juddi/v3/client/ juddi-core/src/main/java/org/apache/juddi/query/ uddi-tck/src/test/java/org/apache/juddi/v3/tck/

Author: kstam
Date: Wed Jan 22 14:36:16 2014
New Revision: 1560361

URL: http://svn.apache.org/r1560361
Log:
JUDDI-785 ignore caseInsensitiveSort

Modified:
    juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIConstants.java
    juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java
    juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java
    juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java
    juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_070_FindEntityIntegrationTest.java

Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIConstants.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIConstants.java?rev=1560361&r1=1560360&r2=1560361&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIConstants.java (original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/UDDIConstants.java Wed Jan 22 14:36:16 2014
@@ -106,7 +106,12 @@ public interface UDDIConstants {
     /**
      * caseInsensitiveSort: signifies that the result set should be sorted
      * without regard to case. This overrides the default case sensitive sorting
-     * behavior.
+     * behavior. 
+     * 
+     * WARNING: The current JPA specification does NOT support caseInsensitiveSort.
+     * jUDDI therefore *ignores* the caseInsensitive sort setting. 
+     * See also https://issues.apache.org/jira/browse/OPENJPA-1817
+     * A work around is to perform a caseInsensitiveMatch. 
      */
     public static final String CASE_INSENSITIVE_SORT = "caseInsensitiveSort";
     /**

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java?rev=1560361&r1=1560360&r2=1560361&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java Wed Jan 22 14:36:16 2014
@@ -115,8 +115,14 @@ public class FetchBusinessEntitiesQuery 
 	private static void appendSortCriteria(DynamicQuery qry, FindQualifiers fq) {
 		
 		String nameTerm = buildAlias(FindBusinessByNameQuery.ENTITY_NAME_CHILD) + ".name";
-		if (fq.isCaseInsensitiveSort())
-			nameTerm = "upper(" + nameTerm + ")";
+		
+		if (fq.isCaseInsensitiveSort()) {
+			// See JUDDI-785
+			log.info("jUDDI does not support caseInsensitive sort, as JPA does not support sortBy "
+					+ "with UPPER or LOWER, see https://issues.apache.org/jira/browse/OPENJPA-1817. "
+					+ "A work around is to do a caseInsentive Match.");
+			//nameTerm = "upper(" + nameTerm + ")";
+		}
 		
 		String dateTerm = ENTITY_ALIAS + ".modified";
 

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java?rev=1560361&r1=1560360&r2=1560361&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java Wed Jan 22 14:36:16 2014
@@ -115,9 +115,13 @@ public class FetchBusinessServicesQuery 
 	private static void appendSortCriteria(DynamicQuery qry, FindQualifiers fq) {
 		
 		String nameTerm = buildAlias(FindServiceByNameQuery.ENTITY_NAME_CHILD) + ".name";
-		if (fq.isCaseInsensitiveSort())
-			nameTerm = "upper(" + nameTerm + ")";
-		
+		if (fq.isCaseInsensitiveSort()) {
+			// See JUDDI-785
+			log.info("jUDDI does not support caseInsensitive sort, as JPA does not support sortBy "
+					+ "with UPPER or LOWER, see https://issues.apache.org/jira/browse/OPENJPA-1817. "
+					+ "A work around is to do a caseInsentive Match.");
+			//nameTerm = "upper(" + nameTerm + ")";
+		}
 		String dateTerm = ENTITY_ALIAS + ".modified";
 
 		String orderClause = nameTerm + " " + DynamicQuery.SORT_ASC + ", " + dateTerm + " " + DynamicQuery.SORT_DESC;

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java?rev=1560361&r1=1560360&r2=1560361&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java Wed Jan 22 14:36:16 2014
@@ -113,9 +113,13 @@ public class FetchTModelsQuery extends T
 	private static void appendSortCriteria(DynamicQuery qry, FindQualifiers fq) {
 		
 		String nameTerm = ENTITY_ALIAS + ".name";
-		if (fq.isCaseInsensitiveSort())
-			nameTerm = "upper(" + nameTerm + ")";
-		
+		if (fq.isCaseInsensitiveSort()) {
+			// See JUDDI-785
+			log.info("jUDDI does not support caseInsensitive sort, as JPA does not support sortBy "
+					+ "with UPPER or LOWER, see https://issues.apache.org/jira/browse/OPENJPA-1817. "
+					+ "A work around is to do a caseInsentive Match.");
+			//nameTerm = "upper(" + nameTerm + ")";
+		}
 		String dateTerm = ENTITY_ALIAS + ".modified";
 
 		String orderClause = nameTerm + " " + DynamicQuery.SORT_ASC + ", " + dateTerm + " " + DynamicQuery.SORT_DESC;

Modified: juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_070_FindEntityIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_070_FindEntityIntegrationTest.java?rev=1560361&r1=1560360&r2=1560361&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_070_FindEntityIntegrationTest.java (original)
+++ juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_070_FindEntityIntegrationTest.java Wed Jan 22 14:36:16 2014
@@ -15,7 +15,9 @@
 package org.apache.juddi.v3.tck;
 
 import java.util.Arrays;
+
 import javax.xml.ws.BindingProvider;
+
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -345,26 +347,45 @@ public class UDDI_070_FindEntityIntegrat
 //</editor-fold>
 
         //<editor-fold defaultstate="collapsed" desc="CASE_INSENSITIVE_SORT">
+        /**
+         * Note that jUDDI ignores caseInsensiveSort. 
+         * 
+         * @See UDDIConstants.CASE_INSENSITIVE_SORT 
+         * @throws Exception
+         */
         @Test
-        @Ignore
         public void UDDI_764caseInsensitiveSortBusiness() throws Exception {
-                findbuinsess(UDDIConstants.CASE_INSENSITIVE_SORT);
+				findbuinsess(UDDIConstants.CASE_INSENSITIVE_SORT);
         }
 
+        
+        /**
+         * Note that jUDDI ignores caseInsensiveSort. 
+         * 
+         * @See UDDIConstants.CASE_INSENSITIVE_SORT 
+         * @throws Exception
+         */
         @Test
-        @Ignore
         public void UDDI_764caseInsensitiveSortService() throws Exception {
                 findservice(UDDIConstants.CASE_INSENSITIVE_SORT);
         }
-
+        /**
+         * Note that jUDDI ignores caseInsensiveSort. 
+         * 
+         * @See UDDIConstants.CASE_INSENSITIVE_SORT 
+         * @throws Exception
+         */
         @Test
-        @Ignore
         public void UDDI_764caseInsensitiveSortTModel() throws Exception {
                 findtmodel(UDDIConstants.CASE_INSENSITIVE_SORT);
         }
-
+        /**
+         * Note that jUDDI ignores caseInsensiveSort. 
+         * 
+         * @See UDDIConstants.CASE_INSENSITIVE_SORT 
+         * @throws Exception
+         */
         @Test
-        @Ignore
         public void UDDI_764caseInsensitiveSortBinding() throws Exception {
                 try {
                         findbinding(UDDIConstants.CASE_INSENSITIVE_SORT);
@@ -374,9 +395,13 @@ public class UDDI_070_FindEntityIntegrat
                         logger.debug("Expected failure: " + ex.getMessage(), ex);
                 }
         }
-
+        /**
+         * Note that jUDDI ignores caseInsensiveSort. 
+         * 
+         * @See UDDIConstants.CASE_INSENSITIVE_SORT 
+         * @throws Exception
+         */
         @Test
-        @Ignore
         public void UDDI_764caseInsensitiveSortRelatedBiz() throws Exception {
                 findrelated(UDDIConstants.CASE_INSENSITIVE_SORT);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org