openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hthom...@apache.org
Subject svn commit: r1756047 - in /openjpa/trunk: ./ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MappedQueryResultObjectProvider.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/sqlresultmapping/
Date Thu, 11 Aug 2016 20:43:28 GMT
Author: hthomann
Date: Thu Aug 11 20:43:27 2016
New Revision: 1756047

URL: http://svn.apache.org/viewvc?rev=1756047&view=rev
Log:
OPENJPA-2651: Fix for issue where @SqlResultSetMapping is used with inheritance and a ManyToOne
relationship.  Merged 2.2.x commit to trunk.

Added:
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/sqlresultmapping/
      - copied from r1756046, openjpa/branches/2.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/query/sqlresultmapping/
Modified:
    openjpa/trunk/   (props changed)
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MappedQueryResultObjectProvider.java

Propchange: openjpa/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 11 20:43:27 2016
@@ -2,5 +2,5 @@
 /openjpa/branches/2.0.x:1504611
 /openjpa/branches/2.1.x:1415379,1415398,1485010,1513249,1517838,1530146,1533218,1533280,1539188,1569528,1575444,1591536,1636464,1655218,1662610,1673300,1673491,1686894,1709201,1709309,1750036
 /openjpa/branches/2.2.1.x:1415367,1415413,1415425,1504719,1508186,1530347,1533222,1539193,1651808,1686910
-/openjpa/branches/2.2.x:1384400,1415459-1415460,1415469,1485013,1530364,1533223,1580898,1580939,1591681,1631786,1641906,1642555,1666312,1686911,1700884,1702143,1728038
+/openjpa/branches/2.2.x:1384400,1415459-1415460,1415469,1485013,1530364,1533223,1580898,1580939,1591681,1631786,1641906,1642555,1666312,1686911,1700884,1702143,1728038,1756046
 /openjpa/branches/2.3.x:1533462,1535560,1536912,1540277,1564121

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MappedQueryResultObjectProvider.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MappedQueryResultObjectProvider.java?rev=1756047&r1=1756046&r2=1756047&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MappedQueryResultObjectProvider.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/MappedQueryResultObjectProvider.java
Thu Aug 11 20:43:27 2016
@@ -404,6 +404,20 @@ class MappedQueryResultObjectProvider
                 return _res.getLong((Column) obj, joins);
             return _res.getLong(obj);
         }
+        
+        /*
+         * OPENJPA-2651: Added to allow the column to be translated (from the
+         * actual column name to the name provided in an @SqlResultSetMapping/@FieldResult.
+         * 
+         * (non-Javadoc) 
+         * @see org.apache.openjpa.jdbc.sql.AbstractResult#getObject(org.apache.
+         * openjpa.jdbc.schema.Column, java.lang.Object, org.apache.openjpa.jdbc.sql.Joins)
+         */
+        public Object getObject(Column col, Object arg, Joins joins)
+            throws SQLException {
+            return getObjectInternal(translate(col, joins), col.getJavaType(),
+                arg, joins);
+        }
 
         protected Object getObjectInternal(Object obj, int metaTypeCode,
             Object arg, Joins joins)



Mime
View raw message