You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "matrei (via GitHub)" <gi...@apache.org> on 2026/10/06 14:16:09 UTC
[PR] Hibernate 5: warn when a many-to-many has no belongsTo on either side [grails-core]
matrei opened a new pull request, #16542:
URL: https://github.com/apache/grails-core/pull/16542
Related to #16532.
## Problem
When neither side of a bidirectional many-to-many declares `belongsTo`, both collections are bound inverse, so nothing is written to the join table and the relationship is silently lost.
## Change
Log a warning at startup for such a mapping, once per relationship, naming both sides and the `belongsTo` to declare. The mapping itself is unchanged; actually choosing an owner (or failing at startup) changes runtime behavior and is left for a major version. The many-to-many guide now says that one side must declare `belongsTo`.
## Tests
New `ManyToManyWithoutOwnerWarningSpec` (the warning feature fails without the change). `grails-data-hibernate5-core`: 621 tests, 0 failures. No existing fixture in the module triggers the warning.
--
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 5: warn when a many-to-many has no belongsTo on either side [grails-core]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #16542:
URL: https://github.com/apache/grails-core/pull/16542#issuecomment-6019891453
## ✅ All tests passed ✅
🏷️ Commit: 6fd43e0d14e1c07e13813a1d69e8b432ac0bc89f
▶️ Tests: 50949 executed
⚪️ Checks: 54/54 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 5: warn when a many-to-many has no belongsTo on either side [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on PR #16542:
URL: https://github.com/apache/grails-core/pull/16542#issuecomment-6026854150
This is a backport from an already approved PR, merging 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: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Hibernate 5: warn when a many-to-many has no belongsTo on either side [grails-core]
Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty merged PR #16542:
URL: https://github.com/apache/grails-core/pull/16542
--
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