jdaugherty commented on PR #16344: URL: https://github.com/apache/grails-core/pull/16344#issuecomment-5730908711
Two follow-ups on `ab537bc5dd` in `6ac4136c66`, plus the docs it was missing. **Persist-on-flush cascade action.** The `create-onflush` registration delegated to a plain `DefaultPersistEventListener`, whose cascade action is `PERSIST`, while Hibernate's default listener for that event is `DefaultPersistOnFlushEventListener` with `PERSIST_ON_FLUSH` (children cascaded during a flush go through `persistOnFlush`, and `deleteOrphans()` is true). The interceptor now supplies a dedicated listener for that event that extends `DefaultPersistOnFlushEventListener` and publishes the same GORM persist event, and `EventListenerIntegrator` replaces Hibernate's default for that event when such a listener is registered. `ClosureEventTriggeringInterceptorSpec` checks the merge, persist and persist-on-flush listener groups end to end and that a book reached from a managed shelf only at flush time publishes a `PersistEvent` before its `PostInsertEvent`; explicit persist and merge events are covered as well. **Documentation.** Hibernate 7 now publishes GORM `PersistEvent` and `MergeEvent` to persistence event listeners, where Hibernate 5 publishes `SaveOrUpdateEvent`. The custom event listener section of the Hibernate 7 events guide and a new What's New entry describe that, together with the `version` change from #16349. The PR description covers the #16349 change now too. **`lock(Map)` guard.** `GormEntity.lock(Serializable)` rejects any map again. GORM composite identifiers are entity instances rather than maps, and `convertIdentifier` turns a map into `null`, so the narrowing only traded the explanatory message for an obscure failure. Also in `c4f3fee64f`: `Issue16349Spec` gains the `tablePerConcreteClass` case and the union feature in `Hibernate7RefreshLockSpec` asserts literal versions again. **Runs** (`DO_NOT_CACHE_TESTS=1`, `--no-build-cache`): | Run | Result | |---|---| | `grails-datamapping-core:test` (full) | 1015 tests, 0 failures | | `grails-data-hibernate7-core:test` (full) | 3173 tests, 0 failures, 24 skipped | | `grails-data-hibernate5-core:test` (full) | 917 tests, 0 failures, 33 skipped | | `codeStyle` on the three modules | 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]
