openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fayw...@apache.org
Subject svn commit: r955400 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Date Wed, 16 Jun 2010 21:28:11 GMT
Author: faywang
Date: Wed Jun 16 21:28:11 2010
New Revision: 955400

URL: http://svn.apache.org/viewvc?rev=955400&view=rev
Log:
OPENJPA-1699: clean up code

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

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=955400&r1=955399&r2=955400&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Wed Jun 16 21:28:11 2010
@@ -1036,39 +1036,34 @@ public class DB2Dictionary
             }
         }
     }
-    
+
+    @Override
     public void insertBlobForStreamingLoad(Row row, Column col, 
             JDBCStore store, Object ob, Select sel) throws SQLException {
         if (ob != null) {
-            if (ob instanceof InputStream) {
-                InputStream is = (InputStream)ob;
-                row.setBinaryStream(col, is, -1);
-            } else
-                row.setBinaryStream(col, 
-                        new ByteArrayInputStream(new byte[0]), 0);
+            row.setBinaryStream(col, (InputStream)ob, -1);
         } else {
             row.setNull(col);
         }
     }
 
+    @Override
     public void insertClobForStreamingLoad(Row row, Column col, Object ob)
     throws SQLException {
         if (ob != null) {
-            if (ob instanceof Reader) {
-                row.setCharacterStream(col, (Reader)ob, -1);
-            } else
-                row.setCharacterStream(col,
-                        new CharArrayReader(new char[0]), 0);
+            row.setCharacterStream(col, (Reader)ob, -1);
         } else {
             row.setNull(col);
         }
     }
 
+    @Override
     public void updateBlob(Select sel, JDBCStore store, InputStream is)
         throws SQLException {
         //NO-OP
     }
 
+    @Override
     public void updateClob(Select sel, JDBCStore store, Reader reader)
         throws SQLException {
         //NO-OP



Mime
View raw message