The GitHub Actions job "Groovy Snapshot Canary Build" on grails-core.git/8.0.x 
has succeeded.
Run started by GitHub user borinquenkid (triggered by borinquenkid).

Head commit for run:
01abdd70afdc85acc5bd67bd4fb7ccc4a0de0ffa / Walter B Duque de Estrada 
<[email protected]>
Hibernate 7: an inverse many-to-many reads the join table its owner writes 
(#16531)

* fix: inverse side of a many-to-many adopts the owner's join table

The inverse side of a bidirectional many-to-many derived its join table name
and key/column names from its own mapping. When only the owning side configured
joinTable, the owner wrote one table and the inverse side read a different,
default-named one, so rows persisted through the owner were invisible through
the inverse side.

CollectionBinder now lets a non-owning many-to-many without its own join table
name adopt the owner's name, schema and catalog, with key and column swapped
(its key is the owner's column, its column is the owner's key). An inverse side
that names its own join table is left untouched, so mappings that configure both
sides (the documented form) behave as before.

Hibernate 5 (GrailsDomainBinder.calculateTableForMany) has the same
inverse-from-own-mapping lookup, so there both sides had to repeat joinTable;
this makes the owner-only configuration work in Hibernate 7.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs: say that only Hibernate 7 swaps the key and column of the inverse join 
table

Hibernate 5 takes each side's element column from the other side's key, so
there only the table, schema and catalog are inherited (#16540). The sentence
about the key/column swap applied to Hibernate 7 only; say so, as suggested in
the review.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs: say that the owning side must name its joinTable for the inverse side 
to inherit it

Nothing is inherited when the owning side configures only key or column
without a name, in both Hibernate 5 and Hibernate 7. Wording as suggested in
the review.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>

Report URL: https://github.com/apache/grails-core/actions/runs/37500496764

With regards,
GitHub Actions via GitBox

Reply via email to