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

   ## Problem
   `insertable: false` / `updatable: false` in a mapping were ignored. 
`PropertyBinder` set the flags from the mapping and then overwrote them with 
`value.hasAnyInsertableColumns()` / `hasAnyUpdatableColumns()`, which are true 
for any normal column. A column with a DB default was written by the app 
anyway, and an `updatable: false` column changed on update.
   
   ## Fix
   `insertable && value.hasAnyInsertableColumns()` (likewise for updatable): an 
explicit false is honoured, and a value with no writable columns stays 
non-writable. The bidirectional-list many-to-one case keeps its effective 
behaviour (left to its columns); its dead false/false branch is not made live 
here, since that would be a separate behaviour change.
   
   ## Tests
   New `InsertableUpdatableMappingSpec` through the GORM API with native reads, 
plus rows in `PropertyBinderSpec`. They failed before. `cfg.*`, 
`grails.gorm.*`, `org.grails.orm.hibernate.*`: 3067 passed; no existing spec 
relied on the old behaviour.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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