-
Notifications
You must be signed in to change notification settings - Fork 698
Closed
Description
Before 3.0.5 the following was working for reactive before save callbacks:
public class MyBeforeSaveCallback<T> implements ReactiveBeforeSaveCallback<T> {
@Override
public Publisher<T> onBeforeSave(T entity, Document document, String collection) {...}
}
Then it could be defined as a bean like this:
@Bean
MyBeforeSaveCallback<Object> myCallback() {...}
This callback was found for arbitrary type.
In spring-data 3.0.5 this has stopped working. The callback is not found for any given type.
The change breaking this was most probably introduced with #2812
Workaround
The simplest workaround I found was just to eliminate the generic T and hardcode Object in MyBeforeSaveCallback like:
public class MyBeforeSaveCallback implements ReactiveBeforeSaveCallback<Object> {
@Override
public Publisher<Object> onBeforeSave(Object entity, Document document, String collection) {...}
}
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug