You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "borinquenkid (via GitHub)" <gi...@apache.org> on 2026/10/05 19:52:12 UTC
[PR] Hibernate 7: an inverse many-to-many reads the join table its owner writes [grails-core]
borinquenkid opened a new pull request, #16531:
URL: https://github.com/apache/grails-core/pull/16531
## Problem
In a bidirectional many-to-many where only the **owning** side configures `joinTable: [name:, key:, column:]`, the inverse side names its join table from its own (default) mapping, so it reads a table nobody writes: `Inverse.get(id).owners` is empty although the owner saved the relationship.
## Fix
`CollectionBinder.inheritOwningJoinTable`: a non-owning many-to-many without its own join table name adopts the owner's name, schema and catalog; its key is the owner's `column` and its column is the owner's `key`. An inverse side that names its own table is untouched.
## Notes
Hibernate 5 does the same lookup from the inverse side's own mapping, so it also needs `joinTable` on both sides (the documented example does); this is not an H7 regression but a gap that H7 can close. Low risk: only affects inverse sides that had no join table name of their own, which previously pointed at an unused table. Short note added to `joinTable.adoc`.
## Tests
New `ManyToManyInverseJoinTableSpec` (persist through the owner, read through the inverse; failed before) and three `CollectionBinderSpec` rows. `cfg.domainbinding*` and `grails.gorm.tests.*`: 1548 tests, 0 failures.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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] Hibernate 7: an inverse many-to-many reads the join table its owner writes [grails-core]
Posted by "borinquenkid (via GitHub)" <gi...@apache.org>.
borinquenkid merged PR #16531:
URL: https://github.com/apache/grails-core/pull/16531
--
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] Hibernate 7: an inverse many-to-many reads the join table its owner writes [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16531:
URL: https://github.com/apache/grails-core/pull/16531#issuecomment-6002380832
## 🚨 All tests passed but jobs failed 🚨
### Failed Jobs without Test Failures
❌ [CI / Spring Security Config Functional Tests \(bcrypt\)](https://github.com/apache/grails-core/actions/runs/37366169213/job/111951769883?pr=16531)
🏷️ Commit: a227adf0b052d7d4c784428a8ab7a951d069d51d
▶️ Tests: 2112 executed
🟡 Checks: 58/81 completed
### Rerun Controls
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
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] Hibernate 7: an inverse many-to-many reads the join table its owner writes [grails-core]
Posted by "matrei (via GitHub)" <gi...@apache.org>.
matrei commented on PR #16531:
URL: https://github.com/apache/grails-core/pull/16531#issuecomment-6018195699
Looks good. Hibernate 5 has the same bug (the inverse side reads an empty default-named table), so I've opened #16540 against `7.0.x`. In H5 only the table name needs inheriting: H5 ignores `column` on a many-to-many and takes each side's element column from the other side's `key`, so the columns already line up.
The new paragraph in `grails-doc/.../joinTable.adoc` is shared by both implementations. The H5 fix makes the table/schema/catalog part true there as well. The key/column swap sentence only applies to Hibernate 7, though, so it might be worth saying so in that sentence.
--
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] Hibernate 7: an inverse many-to-many reads the join table its owner writes [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16531:
URL: https://github.com/apache/grails-core/pull/16531#issuecomment-6020902861
## ✅ All tests passed ✅
🏷️ Commit: 3e3121f90a688efa5edda001121fb9d8b6156ca7
▶️ Tests: 94807 executed
⚪️ Checks: 91/91 completed
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
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] Hibernate 7: an inverse many-to-many reads the join table its owner writes [grails-core]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #16531:
URL: https://github.com/apache/grails-core/pull/16531#issuecomment-6002939367
## [Codecov](https://app.codecov.io/gh/apache/grails-core/pull/16531?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 60.5212%. Comparing base ([`df80e81`](https://app.codecov.io/gh/apache/grails-core/commit/df80e8128b03c029c6e9b40158d9a9b95c6a8110?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a227adf`](https://app.codecov.io/gh/apache/grails-core/commit/a227adf0b052d7d4c784428a8ab7a951d069d51d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 13 commits behind head on 8.0.x.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/grails-core/pull/16531?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## 8.0.x #16531 +/- ##
==================================================
+ Coverage 59.5377% 60.5212% +0.9835%
+ Complexity 25019 24355 -664
==================================================
Files 2175 2090 -85
Lines 108637 103648 -4989
Branches 19823 18947 -876
==================================================
- Hits 64680 62729 -1951
+ Misses 35002 32287 -2715
+ Partials 8955 8632 -323
```
[see 92 files with indirect coverage changes](https://app.codecov.io/gh/apache/grails-core/pull/16531/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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] Hibernate 7: an inverse many-to-many reads the join table its owner writes [grails-core]
Posted by "borinquenkid (via GitHub)" <gi...@apache.org>.
borinquenkid commented on PR #16531:
URL: https://github.com/apache/grails-core/pull/16531#issuecomment-6018812189
Thanks. Updated the paragraph in `joinTable.adoc` so the key/column swap is stated as Hibernate 7 only, and that on Hibernate 5 only the table, schema and catalog are inherited (see #16540).
--
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