You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2013/09/05 17:56:43 UTC

svn commit: r1520354 - in /cxf/branches/2.7.x-fixes: ./ rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java

Author: sergeyb
Date: Thu Sep  5 15:56:43 2013
New Revision: 1520354

URL: http://svn.apache.org/r1520354
Log:
Merged revisions 1520352 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1520352 | sergeyb | 2013-09-05 16:54:02 +0100 (Thu, 05 Sep 2013) | 1 line
  
  [CXF-5253] Also using notLike for wildcard strings
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1520352

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java?rev=1520354&r1=1520353&r2=1520354&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java (original)
+++ cxf/branches/2.7.x-fixes/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java Thu Sep  5 15:56:43 2013
@@ -208,7 +208,16 @@ public abstract class AbstractJPATypedQu
             }
             break;
         case NOT_EQUALS:
-            pred = builder.notEqual(exp, clazz.cast(value));
+            if (clazz.equals(String.class)) {
+                String theValue = SearchUtils.toSqlWildcardString(value.toString(), isWildcardStringMatch());
+                if (theValue.contains("%")) {
+                    pred = builder.notLike((Expression<String>)exp, theValue);
+                } else {
+                    pred = builder.notEqual(exp, clazz.cast(value));
+                }
+            } else {
+                pred = builder.notEqual(exp, clazz.cast(value));
+            }
             break;
         case LESS_THAN:
             pred = builder.lessThan(exp, clazz.cast(value));