db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r472305 - in /db/torque/runtime/trunk/src/java/org/apache/torque/adapter: DBMSSQL.java DBSybase.java
Date Tue, 07 Nov 2006 22:22:15 GMT
Author: tfischer
Date: Tue Nov  7 14:22:14 2006
New Revision: 472305

URL: http://svn.apache.org/viewvc?view=rev&rev=472305
Log:
Use escape clause for LIKE in Sybase but not in MS-SQL

Modified:
    db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBMSSQL.java
    db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBSybase.java

Modified: db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBMSSQL.java
URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBMSSQL.java?view=diff&rev=472305&r1=472304&r2=472305
==============================================================================
--- db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBMSSQL.java (original)
+++ db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBMSSQL.java Tue Nov  7 14:22:14
2006
@@ -40,4 +40,19 @@
     protected DBMSSQL()
     {
     }
+
+    /**
+     * Whether an escape clause in like should be used.
+     * Example : select * from AUTHOR where AUTHOR.NAME like '\_%' ESCAPE '\';
+     * 
+     * TODO: check the following:
+     * MS-SQL does not need this, so this implementation always returns
+     * <code>false</code>.
+     * 
+     * @return whether the escape clause should be appended or not. 
+     */
+    public boolean useEscapeClauseForLike()
+    {
+        return false;
+    }
 }

Modified: db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBSybase.java
URL: http://svn.apache.org/viewvc/db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBSybase.java?view=diff&rev=472305&r1=472304&r2=472305
==============================================================================
--- db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBSybase.java (original)
+++ db/torque/runtime/trunk/src/java/org/apache/torque/adapter/DBSybase.java Tue Nov  7 14:22:14
2006
@@ -187,4 +187,18 @@
         char delim = getStringDelimiter();
         return (delim + new SimpleDateFormat(DATE_FORMAT).format(date) + delim);
     }
+
+    /**
+     * Whether an escape clause in like should be used.
+     * Example : select * from AUTHOR where AUTHOR.NAME like '\_%' ESCAPE '\';
+     * 
+     * Sybase needs this, so this implementation always returns
+     * <code>true</code>.
+     * 
+     * @return whether the escape clause should be appended or not. 
+     */
+    public boolean useEscapeClauseForLike()
+    {
+        return true;
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message