cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1520352 - /cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
Date Thu, 05 Sep 2013 15:54:02 GMT
Author: sergeyb
Date: Thu Sep  5 15:54:02 2013
New Revision: 1520352

URL: http://svn.apache.org/r1520352
Log:
[CXF-5253] Also using notLike for wildcard strings

Modified:
    cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java

Modified: cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java?rev=1520352&r1=1520351&r2=1520352&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
(original)
+++ cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
Thu Sep  5 15:54:02 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));



Mime
View raw message