openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dez...@apache.org
Subject svn commit: r807642 - in /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql: AbstractResult.java ResultSetResult.java
Date Tue, 25 Aug 2009 14:09:24 GMT
Author: dezzio
Date: Tue Aug 25 14:09:23 2009
New Revision: 807642

URL: http://svn.apache.org/viewvc?rev=807642&view=rev
Log:
OpenJPA-525 : Applied Milosz Tylenda's OPENJPA-525.3.patch to trunk, after testing by Amy
Yang.

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

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractResult.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractResult.java?rev=807642&r1=807641&r2=807642&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractResult.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractResult.java
Tue Aug 25 14:09:23 2009
@@ -688,12 +688,12 @@
 
     public Object getObject(Object obj, int metaType, Object arg)
         throws SQLException {
-        return getObjectInternal(translate(obj, null), metaType, arg, null);
+        return getObjectInternal(obj, metaType, arg, null);
     }
 
     public Object getObject(Column col, Object arg, Joins joins)
         throws SQLException {
-        return getObjectInternal(translate(col, joins), col.getJavaType(),
+        return getObjectInternal(col, col.getJavaType(),
             arg, joins);
     }
 
@@ -834,7 +834,8 @@
 
     /**
      * Translate the user-given id or column. This method is called before
-     * delegating to any <code>get*Internal</code> methods. Return the
+     * delegating to any <code>get*Internal</code> methods with the exception
of
+     * <code>getObjectInternal</code>. Return the
      * original value by default.
      */
     protected Object translate(Object obj, Joins joins)

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ResultSetResult.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ResultSetResult.java?rev=807642&r1=807641&r2=807642&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ResultSetResult.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ResultSetResult.java
Tue Aug 25 14:09:23 2009
@@ -357,6 +357,9 @@
         if (metaTypeCode == -1 && obj instanceof Column)
             metaTypeCode = ((Column) obj).getJavaType();
 
+        boolean isClob = (obj instanceof Column) ? ((Column) obj).getType() == Types.CLOB
: false;
+        obj = translate(obj, joins);
+        
         Object val = null;
         switch (metaTypeCode) {
             case JavaTypes.BOOLEAN:
@@ -393,8 +396,7 @@
                 val = new Short(getShortInternal(obj, joins));
                 break;
             case JavaTypes.STRING:
-                return getStringInternal(obj, joins,
-                    obj instanceof Column && ((Column) obj).getType() == Types.CLOB);
+                return getStringInternal(obj, joins, isClob);
             case JavaTypes.OBJECT:
                 return _dict
                     .getBlobObject(_rs, ((Number) obj).intValue(), _store);



Mime
View raw message