openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r497190 - /incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java
Date Wed, 17 Jan 2007 21:48:29 GMT
Author: mprudhom
Date: Wed Jan 17 13:48:27 2007
New Revision: 497190

URL: http://svn.apache.org/viewvc?view=rev&rev=497190
Log:
Fixed concatinate function to cast both sides as a VARCHAR, since DB2 and Derby disallow parameters
on both sides of the function.

Modified:
    incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java

Modified: incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java?view=diff&rev=497190&r1=497189&r2=497190
==============================================================================
--- incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java
(original)
+++ incubator/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java
Wed Jan 17 13:48:27 2007
@@ -31,9 +31,13 @@
         longVarbinaryTypeName = "BLOB";
         varbinaryTypeName = "BLOB";
 
+        // DB2-based databases have restrictions on having uncast parameters
+        // in string functions
         toUpperCaseFunction = "UPPER(CAST({0} AS VARCHAR(1000)))";
         toLowerCaseFunction = "LOWER(CAST({0} AS VARCHAR(1000)))";
         stringLengthFunction = "LENGTH(CAST({0} AS VARCHAR(1000)))";
+        concatenateFunction = "(CAST({0} AS VARCHAR(1000)))||"
+            + "(CAST({1} AS VARCHAR(1000)))";
 
         trimLeadingFunction = "LTRIM({0})";
         trimTrailingFunction = "RTRIM({0})";



Mime
View raw message