Skip to content

Fix @ManagedEntity compilation for Grails domains - #16121

Merged
matrei merged 4 commits into
8.0.xfrom
fix/managed-entity
Aug 11, 2026
Merged

matrei merged 4 commits into
8.0.xfrom
fix/managed-entity

Conversation

@matrei

@matrei matrei commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Fixes compilation failures when @ManagedEntity is used on a Grails domain class.

HibernateEntityTransformation and GormEntityTransformation were sharing the same ClassNode metadata key for their “transformation applied” markers.

The Hibernate transformation overwrote GORM’s marker after invoking it, allowing GORM transformation to run again. Under Grails 8/Groovy 5, the second pass could fail in DirtyCheckingTransformer while collecting getter/setter pairs.

Hibernate transformations now use a dedicated metadata marker, preserving GORM’s marker and making the transformations idempotent.

Changes

  • Added a Hibernate-specific transformation marker for Hibernate 5.
  • Added the same fix for Hibernate 7.
  • Verified compilation of the grails-test-examples-app1 reproducer.
  • Verified the Hibernate 5 and Hibernate 7 transformation tests.

Closes #16107

@codecov

codecov Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.3394%. Comparing base (a1e526f) to head (91ee8a8).
⚠️ Report is 19 commits behind head on 8.0.x.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #16121        +/-   ##
==================================================
- Coverage     52.3431%   52.3394%   -0.0037%     
  Complexity      18296      18296                
==================================================
  Files            2036       2036                
  Lines           96347      96373        +26     
  Branches        16829      16836         +7     
==================================================
+ Hits            50431      50441        +10     
- Misses          38492      38506        +14     
- Partials         7424       7426         +2     

see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jdaugherty jdaugherty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the tests pass, we should merge this.

@testlens-app

testlens-app Bot commented Aug 10, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 91ee8a8
▶️ Tests: 60617 executed
⚪️ Checks: 62/62 completed


Learn more about TestLens at testlens.app.

@matrei
matrei requested a review from jamesfredley August 10, 2026 14:40
@codeconsole
codeconsole self-requested a review August 11, 2026 04:53
@matrei
matrei merged commit 535e814 into 8.0.x Aug 11, 2026
65 checks passed
@matrei
matrei deleted the fix/managed-entity branch August 11, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Grails 8] Using @ManagedEntity on domain class breaks compilation

3 participants