openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fayw...@apache.org
Subject svn commit: r814166 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java
Date Sat, 12 Sep 2009 14:58:07 GMT
Author: faywang
Date: Sat Sep 12 14:58:07 2009
New Revision: 814166

URL: http://svn.apache.org/viewvc?rev=814166&view=rev
Log:
OPENJPA-1295: fix the escape character

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java?rev=814166&r1=814165&r2=814166&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/MatchesExpression.java
Sat Sep 12 14:58:07 2009
@@ -105,10 +105,12 @@
 
             // escape out characters by using the database's escape sequence
             DBDictionary dict = ctx.store.getDBDictionary();
-            if (_escape != null && _escape.equals("\\")) {
-                buf.append(" ESCAPE '").append(dict.searchStringEscape).append("'");
-            } else
-                buf.append(" ESCAPE '").append(_escape).append("'");
+            if (_escape != null) {
+                if (_escape.equals("\\")) 
+                    buf.append(" ESCAPE '").append(dict.searchStringEscape).append("'");
+                else
+                    buf.append(" ESCAPE '").append(_escape).append("'");
+            }
             
         }
         sel.append(buf, state.joins);



Mime
View raw message