jamesfredley commented on PR #15731:
URL: https://github.com/apache/grails-core/pull/15731#issuecomment-4732118617

   ## H7 JSON-view proxy/duplicate-entity id rendering fixed; views app landed
   
   Fixed the remaining grails-views-gson rendering bug and landed the Hibernate 
7 views functional app. New commits: `cc6acc3804`, `33a3a1f349`.
   
   ### Fixed: proxy / duplicate-entity id rendering (`cc6acc3804`)
   The two `TeamSpec` cases that were still failing (deep association + 
composite id) had two root causes, both now fixed:
   
   - `DefaultJsonViewHelper.findEntity` used `object.getClass()`, which for a 
Hibernate proxy is the generated subclass (`Player$HibernateProxy$xxx`) and is 
**not** a registered persistent entity. `findEntity` returned null and the 
proxy was rendered as a plain POGO (via `processSimple`, dropping its id) 
instead of as a domain entity. Now it unwraps the proxy before resolving the 
entity class.
   - `DefaultGrailsJsonViewHelper.preProcessedOutput` returned a cached 
`JsonWritable` bound to the first occurrence's delegate/path/deep state, so a 
repeated instance (e.g. the same player as both a team's captain and a member 
of its players collection) rendered the wrong context and dropped the id. Now 
each occurrence renders fresh; true cyclic associations are still broken 
earlier by the circular-association handling in `process()`.
   
   Verified: full grails-views-gson unit suite **175/175**, and Hibernate 5 
behaviour unchanged.
   
   ### Landed: Hibernate 7 views-functional-tests app (`33a3a1f349`)
   Added `grails-test-examples/hibernate7/views-functional-tests`, a 
near-identical clone of the H5 app (only `build.gradle` differs). **All 52 
integration specs pass on Hibernate 7**, matching H5 - 
association/proxy/inheritance/embedded/circular rendering, deep rendering, HAL, 
and composite ids.
   
   ### Scaffolding status
   Cloning `scaffolding-fields` to H7 boots and passes **123/136** Geb specs 
(CRUD, field types, pagination, custom templates). The remaining 13 (10 
relationship rendering, 2 validation, 1 CRUD) are a **separate** 
scaffolding/fields-vs-H7 issue: bootstrap-seeded association data does not 
appear in scaffolded belongsTo/hasMany/many-to-many forms under H7. This is 
unrelated to the JSON-view rendering path fixed here and is tracked as the 
remaining follow-up (the clone is not landed until it is resolved). The 
breaking-change/coverage tables above are updated accordingly.
   


-- 
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]

Reply via email to