Petar Tahchiev I think that the JPA spec GitHub issue provides a lot of context for this issue. 1. The JPA spec is vague in this regard. Therefore, the spec should change to specify clearly if element collection changes should trigger a Pre/PostUpdate event. 2. I think it's much better if JPA defines a @Pre/PostCollectionPersist event listeners because, this way, we can differentiate between entity state changes and associated element collection changes. Grouping those together will make it hard figuring out what's changed. 3. With Hibernate, you already have a workaround since we define the Pre/PostCollectionUpdateEventListener. 4. You can achieve a similar goal, even without relying on Hibernate, by just using database triggers or CDC (e.g. Debezium). For these reasons, I don't think we should change the current Hibernate behavior. However, I won't close this issue since this is just my opinion and maybe someone else from the team has a different view on this subject. |