mirror of https://github.com/apache/openjpa.git
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. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@643586 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6b5e0c6967
commit
6aa8fd3c35
|
@ -1719,6 +1719,8 @@ public class QueryImpl
|
||||||
rs = 37 * rs + ((query == null) ? 0 : query.hashCode());
|
rs = 37 * rs + ((query == null) ? 0 : query.hashCode());
|
||||||
rs = 37 * rs + ((language == null) ? 0 : language.hashCode());
|
rs = 37 * rs + ((language == null) ? 0 : language.hashCode());
|
||||||
rs = 37 * rs + ((storeKey == null) ? 0 : storeKey.hashCode());
|
rs = 37 * rs + ((storeKey == null) ? 0 : storeKey.hashCode());
|
||||||
|
if (subclasses)
|
||||||
|
rs++;
|
||||||
return rs;
|
return rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1733,18 +1735,16 @@ public class QueryImpl
|
||||||
|| !StringUtils.equals(key.query, query)
|
|| !StringUtils.equals(key.query, query)
|
||||||
|| !StringUtils.equals(key.language, language))
|
|| !StringUtils.equals(key.language, language))
|
||||||
return false;
|
return false;
|
||||||
|
if (key.subclasses != subclasses)
|
||||||
|
return false;
|
||||||
if (!ObjectUtils.equals(key.storeKey, storeKey))
|
if (!ObjectUtils.equals(key.storeKey, storeKey))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// allow either candidate type to be null because it might be
|
// allow either candidate type to be null because it might be
|
||||||
// encoded in the query string, but if both are set then they
|
// encoded in the query string, but if both are set then they
|
||||||
// must be equal
|
// must be equal
|
||||||
if (candidateType != null && key.candidateType != null)
|
return key.candidateType == null || candidateType == null
|
||||||
return candidateType == key.candidateType
|
|| key.candidateType == candidateType;
|
||||||
&& subclasses == key.subclasses;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue