matrei commented on code in PR #16573:
URL: https://github.com/apache/grails-core/pull/16573#discussion_r4347712237
##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/JoinTracker.java:
##########
@@ -52,6 +52,14 @@ public void addJoin(String path, From<?, ?> from) {
return join;
}
+ /**
+ * Returns the join registered by this query, ignoring enclosing queries
because
+ * an association path is relative to the root of the query it appears in.
+ */
+ public From<?, ?> getOwnJoin(String path) {
Review Comment:
Same here: `getOwnJoin` can be package-private. Its only caller is
`ExpressionResolver` in the same package, and `JpaQueryContext` only exposes
the tracker through the protected `getJoinTracker()`.
##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/AliasRegistry.java:
##########
@@ -56,6 +56,13 @@ public boolean isDefined(String alias) {
return false;
}
+ /**
+ * Whether this query declares the alias, independently of any enclosing
query.
+ */
+ public boolean isOwnDefined(String alias) {
Review Comment:
One more small point I missed in the review: this can be package-private.
All its callers (`ExpressionResolver`, `QueryAliasRegistrar`) and
`AliasRegistrySpec` are in `org.grails.orm.hibernate.query`, and
`JpaQueryContext` only exposes the registry through the protected
`getAliasRegistry()`. `QueryAliasRegistrar` is already package-private, and
this keeps the other new internals out of the public surface too. If finding 1
moves to a declared flag on `HibernateAlias`, the call in `QueryAliasRegistrar`
may go away as well.
--
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]