borinquenkid opened a new pull request, #16522: URL: https://github.com/apache/grails-core/pull/16522
## Problem Silent data loss. For an owner with two or more unidirectional to-many properties, the key of a collection of **basic values or enums** (`Set<String>`, `List<Integer>`) was made non-updatable by `CollectionKeyColumnUpdater`, so Hibernate writes no rows: the entity saves without error and reloads with empty collections. ## Fix `key.setUpdateable(property instanceof HibernateToManyCollectionProperty || unidirectionalCount <= 1)`. Entity collections keep the existing rule (needed for #10811 / `TwoUnidirectionalHasManySpec`). ## Tests New `BasicCollectionKeyPersistenceSpec` (persist and reload, plus the single-collection control) and unit rows in `CollectionKeyColumnUpdaterSpec`; both failed before. `domainbinding.*`, `grails.gorm.tests.*`, `*TwoUnidirectional*`, `*HasMany*`, `*Collection*`: 1555 passed. 🤖 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]
