jamesfredley commented on PR #15731: URL: https://github.com/apache/grails-core/pull/15731#issuecomment-4730173459
## CI fixes + Hibernate 7 eager fetch-join fix Fixed the failing CI and the underlying H7 query bug it pointed at. New commits: `81b0c52996`, `fab342ec2d`. ### CI failures fixed - **`Core Projects` (checkstyle):** removed an unused `java.util.Arrays` import left over from the ChainedTransactionManager dedupe fix. - **`MongoDB Functional Tests` + `Coverage - grails-core` (`grails-data-mongodb-core:test`):** the shared TCK test `getAll preserves order for convertible String ids` is Hibernate-specific (MongoDB ObjectId ids are not derived from arbitrary numeric strings), so it failed on Mongo. Moved it out of the datastore-agnostic TCK into `HibernateGetAllConvertibleIdSpec` in both Hibernate modules (H5<->H7 parity preserved; no longer run on Mongo). The version-agnostic getAll tests stay in the TCK. ### Fixed: Hibernate 7 eager fetch joins (`fab342ec2d`) A real H7 regression, surfaced while cloning the views app: `Entity.findById(id, [fetch:[assoc:'join']])` (and dynamic finders) did not eagerly initialize the association on H7, while H5 did - so JSON views silently dropped hasMany collections. Root cause: GORM's `DynamicFinder` turns an EAGER fetch into `query.join(property)`; the rewritten H7 query layer materialized that as a plain JPA `root.join` only when referenced in a predicate (a fetch-only association never is), so it was never fetched. JPA needs `root.fetch(...)`. Fix (H7 only): `HibernateQuery` records fetch-join paths; `JpaCriteriaQueryCreator` materializes them as `root.fetch(path, joinType)` for full-entity selects (count/projection queries skipped). Locked with `FetchJoinSpec` in both modules. The **full `grails-data-hibernate7-core` suite is green (2944 tests, 0 failures)**, so criteria/finder/projection/count/pagination are not regressed; H5 is untouched. ### Views functional app: 48/52 -> 50/52 on H7 With the fetch-join fix, cloning `views-functional-tests` to H7 now passes 50/52 (association + HAL rendering fixed). The remaining 2 (`TeamSpec` deep association + composite ID) hit a **separate, narrower** grails-views-gson bug: an entity loaded via a Hibernate proxy (`Player.load(id)`), or appearing twice in the graph, renders without its `id` under H7 (and a duplicate is de-duplicated to an empty object). H5 renders the ids. That is documented in the tables above as the remaining blocker for landing the `views`/`scaffolding` H7 clones - it is a view-layer (`grails-views-gson`) id-extraction + de-dup issue, not the GORM query bug that is now fixed. CI is re-running on these fixes. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
