You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "fernando88to (via GitHub)" <gi...@apache.org> on 2026/07/25 13:34:48 UTC
[PR] Fix HQL navigation and rename for GORM domains in Grails 3+ [grails-intellij-plugin]
fernando88to opened a new pull request, #6:
URL: https://github.com/apache/grails-intellij-plugin/pull/6
Restores, for **Grails 3+** (Gradle) projects, the behavior that already existed on Grails 2.x:
- **Ctrl+click** on a domain class name inside an HQL query navigates to the class.
- **Rename** of a domain property/class updates the references inside HQL strings.
The feature depends on two independent things, and on Grails 3+ **both** were broken:
1. **HQL language injection into the string** — the old injection (IntelliLang, `languageInjections.xml`) only matched synthetic methods marked with the `DOMAIN_DYNAMIC_METHOD` kind, which
are only generated for GORM < 4. On GORM 4+ the finders (`find`/`findAll`/`executeQuery`/`executeUpdate`) come from the `GormEntity` trait and aren't marked that way, so the injection
never fired.
2. **Resolving names inside the HQL** — the JPA persistence model HQL uses to resolve identifiers is only populated if the module has a Hibernate/JPA facet. That facet is only added by the
legacy Grails 2.x structure-sync path, which doesn't run for Grails 3+ modules imported via Gradle.
## Changes
- **`GormHqlInjector`** (new) — a programmatic `MultiHostInjector` that injects HQL by resolving the domain class directly (`GormUtils.isGormBean`) instead of relying on the synthetic
method marker. Works across all GORM versions.
- **`languageInjections.xml`** — removes the old IntelliLang injection (avoids double injection on GORM < 4).
- **`Grails3HibernateFacetActivity`** (new) — a `postStartupActivity` in the `:hibernate` module that adds a `"Gorm"` Hibernate facet (idempotent) to every Grails 3+ app module, activating
the existing persistence bridge (`GormSessionFactoryContributor` → `GormPersistenceMapping` → `GormEntity`).
- Registered the new components in `plugin.xml` and in the `:hibernate` module descriptor.
## Test plan
- [x] `./gradlew compileJava` and `:hibernate:compileJava` — succeed.
- [x] `./gradlew test --tests 'GormHqlInjectionTest'` — 5/5 tests passing (cover injection on `find`/`executeQuery`, an unqualified call inside the domain class, and the negative cases: a
non-finder method and a non-domain qualifier).
- [x] `./gradlew rat` — new files approved (`AL`), no pending license issues.
- [ ] Manual validation on a real Grails 3+ project (`./gradlew runIde`): confirm the "Gorm" Hibernate facet appears in Project Structure, Ctrl+click navigates to the domain class inside
`executeQuery`, and renaming a property updates the query.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix HQL navigation and rename for GORM domains in Grails 3+ [grails-intellij-plugin]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #6:
URL: https://github.com/apache/grails-intellij-plugin/pull/6#issuecomment-5083296880
@fernando88to thank you for your contribution! I intend to merge this after the tests finish, but as a heads up: if you're still planning on contributing more changes, there will be some significant refactoring taking place in the next week. This includes:
1. Conversion away from kotlin where possible
2. Significant package renames (org.apache.grails.intellij as a base package)
3. Continued work to make this releasable per ASF guidelines.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix HQL navigation and rename for GORM domains in Grails 3+ [grails-intellij-plugin]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty merged PR #6:
URL: https://github.com/apache/grails-intellij-plugin/pull/6
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix HQL navigation and rename for GORM domains in Grails 3+ [grails-intellij-plugin]
Posted by "fernando88to (via GitHub)" <gi...@apache.org>.
fernando88to commented on PR #6:
URL: https://github.com/apache/grails-intellij-plugin/pull/6#issuecomment-5090937960
Thanks, I'll wait a bit longer for the next ones now.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix HQL navigation and rename for GORM domains in Grails 3+ [grails-intellij-plugin]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #6:
URL: https://github.com/apache/grails-intellij-plugin/pull/6#issuecomment-5091279094
@fernando88to I believe I've finished the majority of these migrations. It should be safe now if you pull the latest main branch. Anything forward should be incremental.
--
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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org