Community
Participate
Working Groups
If you use a query-key defined for a field inside an aggregate then in-memory querying does not work. This can break conforming, in-memory querying and update/delete-all invalidation. This is because in conforming an expression if we can't find a mapping for the query-key we try to find a mapping for the query-key's field. This works out ok for direct-mappings but if the mapping was inside an aggregate we find the aggregate then end up comparing the aggregate object with the direct value and think the object does not conform (or does if inside a not). Needs to be fixed by only using the mapping for the field if the query-key was a direct-query-key and if the mapping is a direct-mapping. Also noticed the code in this method (QueryKeyExpression.valueFromCollection) under, // For bug 2780817 get the mapping directly from the object. In EJB 2.0 Is wrong, as it uses the expression's name not the mapping's, which will cause a null-pointer if the mapping was null (for query-key's field).
5934088
Created attachment 180214 [details] Proposed fix and testcase
Created attachment 180269 [details] Proposed fix and testcase (with all files)
Created attachment 181316 [details] Fix and test with revised fix to QueryKeyExpression
Fixed in trunk revision: 8379 Reviewed: James Sutherland
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink