openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1688947 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
Date Fri, 03 Jul 2015 06:08:44 GMT
Author: struberg
Date: Fri Jul  3 06:08:44 2015
New Revision: 1688947

URL: http://svn.apache.org/r1688947
Log:
OPENJPA-2341 fix ValueHandler pickup via FieldStrategies

Sadly this atm only works for fields which are Serializable. 
Menas the ValueHandler can just change the presentation right now
but it doesn't work for mapping non-Serializable classes like
java.security.Principal.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java?rev=1688947&r1=1688946&r2=1688947&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingRepository.java
Fri Jul  3 06:08:44 2015
@@ -840,6 +840,18 @@ public class MappingRepository extends M
             return new HandlerFieldStrategy();
         }
 
+        // check for an explicitly mapped strategy
+        Object explicitStrat = mappedStrategy(field, field.getType(), adapting);
+        if (explicitStrat != null) {
+            if (explicitStrat instanceof FieldStrategy)
+                return (FieldStrategy) explicitStrat;
+            if (explicitStrat != null) {
+                if (installHandlers)
+                    field.setHandler((ValueHandler) explicitStrat);
+                return new HandlerFieldStrategy();
+            }
+        }
+
         if (field.isSerialized()) {
             if (_dict.maxEmbeddedBlobSize != -1) {
                 handler = defaultHandler(field, adapting);
@@ -849,16 +861,6 @@ public class MappingRepository extends M
                 }
                 return new MaxEmbeddedBlobFieldStrategy();
             }
-        } else {
-            // check for mapped strategy
-            Object strat = mappedStrategy(field, field.getType(), adapting);
-            if (strat instanceof FieldStrategy)
-                return (FieldStrategy) strat;
-            if (strat != null) {
-                if (installHandlers)
-                    field.setHandler((ValueHandler) strat);
-                return new HandlerFieldStrategy();
-            }
         }
 
         // check for known field strategies



Mime
View raw message