codeconsole commented on PR #16297: URL: https://github.com/apache/grails-core/pull/16297#issuecomment-5670102878
Thanks for the approval. All six round-5 suggestions are in, one commit each. | commit | suggestion | |---|---| | `55ee2e3` | an identifier passed for an association fails with a reflector error | | `7d302c5` | misnamed null test, and the DBRef null drop untested | | `87d38b3` | `hasOne` rejection untested on the mapping engine | | `983fd08` | many-to-many `updateAll` untested on the codec engine | | `44750eb` | dead `ManyToMany` check | | `a173953` | `updateAll` undocumented | **Identifier values.** Both engines now resolve a value in order: a proxy through the proxy factory, an instance of the associated class through the reflector, and anything else as the identifier itself. It is then coerced to the target's stored type as before. I applied it to to-many elements as well as to-one, so `updateAll(tags: [a.id, b.id])` behaves the same as passing the instances. Tests cover a hex String and an `ObjectId` for to-one on the codec engine, a to-one id on the mapping engine, and to-many ids on the codec engine. All fail without the change. **Null handling.** The plain-list case is renamed to say the null is kept. A new `reference: true` case asserts the null is dropped, that the remaining entry is a `DBRef` carrying the stored `ObjectId`, and that it reads back. **Docs.** There is a new "Bulk Updates" section in `querying/queryingBasics.adoc`. It explains how association values are written, that an instance or an identifier can be passed, and which association kinds bulk updates support and why. For `hasOne` and bidirectional one-to-many, it says to update the side that holds the foreign key. `grails-data-mongodb-core` is at parity with `8.0.x` locally. The only failures are the two pre-existing `MongoDatastoreLifecycleSpec` cases, which also fail on an unmodified checkout here. Checkstyle and CodeNarc are clean. -- 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]
