jamesfredley commented on code in PR #16773:
URL: https://github.com/apache/grails-core/pull/16773#discussion_r4411563733


##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/JpaQueryContext.java:
##########
@@ -124,6 +141,9 @@ public void addFrom(String path, From<?, ?> from) {
 
     public void registerAlias(String alias, Expression<?> expression) {
         aliasRegistry.realize(alias, expression);
+        if (!isSubquery && parent != null) {
+            parent.registerAlias(alias, expression);

Review Comment:
   homeAddress { eq('country.name', 'USA') } then workAddress { 
eq('country.name', 'Canada') } should return the person with that pair of 
addresses. registerAlias publishes the implicit country join to the shared 
parent, so the second predicate reuses the home country and the person is 
excluded. Keep that implicit path on the association that declared it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to