cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r898299 - in /cayenne/main/branches/STABLE-3.0: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/CharType.java
Date Tue, 12 Jan 2010 12:13:29 GMT
Author: aadamchik
Date: Tue Jan 12 12:13:28 2010
New Revision: 898299

URL: http://svn.apache.org/viewvc?rev=898299&view=rev
Log:
CAY-1298 String no longer works in query when column type is Integer
(cherry picked from commit 28a125f658bb7a23a0a14f5b84d3562d73736655)

Modified:
    cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/CharType.java

Modified: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=898299&r1=898298&r2=898299&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/RELEASE-NOTES.txt Tue Jan
12 12:13:28 2010
@@ -20,6 +20,7 @@
 
 Bug Fixes Since 3.0RC1:
 
+CAY-1298 String no longer works in query when column type is Integer
 CAY-1349 SelectQuery 'fetchSize' setting is not propagated to disjoint prefetches
 CAY-1351 EntityResolver.getEmbeddable(...) always returns null
 CAY-1353 warning "attribute.name" contains invalid character: . in Code generation dialog

Modified: cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/CharType.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/CharType.java?rev=898299&r1=898298&r2=898299&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/CharType.java
(original)
+++ cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/CharType.java
Tue Jan 12 12:13:28 2010
@@ -152,12 +152,22 @@
 
     public void setJdbcObject(
             PreparedStatement st,
-            Object val,
+            Object value,
             int pos,
             int type,
-            int precision) throws Exception {
+            int scale) throws Exception {
 
-        st.setString(pos, (String) val);
+        // if this is a CLOB column, set the value as "String"
+        // instead. This should work with most drivers
+        if (type == Types.CLOB) {
+            st.setString(pos, (String) value);
+        }
+        else if (scale != -1) {
+            st.setObject(pos, value, type, scale);
+        }
+        else {
+            st.setObject(pos, value, type);
+        }
     }
 
     protected String readClob(Clob clob) throws IOException, SQLException {



Mime
View raw message