openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r643586 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
Date Tue, 01 Apr 2008 21:29:27 GMT
Author: awhite
Date: Tue Apr  1 14:29:26 2008
New Revision: 643586

URL: http://svn.apache.org/viewvc?rev=643586&view=rev
Log:
Always consider the inclusion of subclasses as part of the query compilation
key, even when the candidate class is encoded in the query string instead of
set programmatically. 


Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java?rev=643586&r1=643585&r2=643586&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryImpl.java Tue
Apr  1 14:29:26 2008
@@ -1719,6 +1719,8 @@
             rs = 37 * rs + ((query == null) ? 0 : query.hashCode());
             rs = 37 * rs + ((language == null) ? 0 : language.hashCode());
             rs = 37 * rs + ((storeKey == null) ? 0 : storeKey.hashCode());
+            if (subclasses)
+              rs++;
             return rs;
         }
 
@@ -1733,18 +1735,16 @@
                 || !StringUtils.equals(key.query, query)
                 || !StringUtils.equals(key.language, language))
                 return false;
-
+            if (key.subclasses != subclasses)
+                return false;
             if (!ObjectUtils.equals(key.storeKey, storeKey))
                 return false;
 
             // allow either candidate type to be null because it might be
             // encoded in the query string, but if both are set then they
             // must be equal
-            if (candidateType != null && key.candidateType != null)
-                return candidateType == key.candidateType
-                    && subclasses == key.subclasses;
-
-            return true;
+            return key.candidateType == null || candidateType == null
+                || key.candidateType == candidateType;
         }
     }
 



Mime
View raw message