matrei opened a new pull request, #16830:
URL: https://github.com/apache/grails-core/pull/16830

   ## Description
   
   Upgrade note 21, *Data binding white lists apply wherever a class is 
compiled*, lists the classes that get a data binding white list since 7.0.18 
(ce2db7a52d3), but not GORM entities compiled outside `grails-app/domain`. They 
are among them, and they bind differently now. This adds a bullet for them:
   
   > A GORM entity compiled outside `grails-app/domain`, such as an `@Entity` 
class in `src/main/groovy` or in a shared module, now gets the list a domain 
class in `grails-app/domain` gets, as GORM declares a `transients` list on 
every entity, and is bound by the same rules. In particular, `bindData` no 
longer binds its `id`, `version`, `dateCreated` and `lastUpdated`. Previously 
such a class was bound without restriction, its `id` and `version` included.
   
   Such an entity got no list before, as only a domain class in 
`grails-app/domain` or one annotated with `grails.persistence.Entity` did. 
GORM's entity transformation gives every entity a `transients` list, and since 
7.0.18 a class that declares one gets the list wherever it is compiled. Binding 
`[id: 5, version: 3, title: 'Grails']` into a GORM `@Entity` compiled in a 
module's sources, through `DataBindingUtils.bindObjectToInstance`, which 
`bindData` uses:
   
   | | `id` | `version` | `title` | white list |
   |---|---|---|---|---|
   | without ce2db7a52d3 | `5` | `3` | `Grails` | none |
   | with ce2db7a52d3 | `null` | `null` | `Grails` | yes |
   
   This came up in #16829, where two specs on 8.0.x relied on such a class 
binding its id.
   
   ### Merging up
   
   On 8.0.x the same note is note 89 in `upgrading80x.adoc`, and 
`upgrading60x.adoc` there has no note 21, so the bullet has to be added to note 
89 when this is merged up.
   
   ### Checks
   
   I checked the binding on 8.0.x, which has the same change. I did not build 
the guide for this one line.
   


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