There are 2 options I think to solve this.
-
Have CallbackRegistryImpl track callbacks by entity name, not just the entity class.
-
Have CallbackRegistryImpl skip putting entity class into its internal callback maps when a Class is found to have no callbacks.
(1) is the more correct solution, but requires some SPI changes. (2) works in the majority of cases like the reported ones.
So I'd suggest applying (2) to 5.0 and creating a enhancement request for 5.1 to change the signatures as needed to track callbacks by entity name.
|