This is a follow up of the resolved bug that was fixed in 5.2.17 and was presented in the article
How to use @PrePersist and @PreUpdate on Embeddable with JPA and Hibernate
When the @Embeddable containing the @PrePersist is embedded in a entity that is the a parent entity in a relation with strategy JOINED then the @PrePersist fails to trigger and the columns are not updated
The issue seems to be the following:
lets say we have the superclass A that has the @PrePresist annotation and a subclass B that extends the A,
Initially the @PrePersist annotation are scanned and are added in a Map . The key of the map is the class the @PrePersist annotation is found. So in our case it will be registered under the key "A"
When the entity B is going to be saved, the callbacks for this entity are executed, but there is no @PrePersist callback in the callbacks registry (the aforementioned map) under the key B.
So naively i guess that either in the annotation discovery we need also to register all the extending classes of A,
Or, during the persist of an entity we need to check if there is any @PrePersist callback registered for its parent
The relevant methods are :