We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
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) {...} }
The text was updated successfully, but these errors were encountered:
Yes, I have the same problem with Spring Data JDBC and my BeforeConvertCallback:
@Bean BeforeConvertCallback<DomainEntity> uuidGenerator() { return entity -> { if (entity.getId() == null) { entity.setId(UUID.randomUUID()); } return entity; }; }
It's not called anymore. The Workaround with an extra class resolves the problem. DomainEntity here is an interface.
Sorry, something went wrong.
Fix too restrictive entity callback matching.
bd64ed8
We now properly support generic entity callbacks defined via lambda declarations. Fixes #2822.
979e0f4
Sorry for the inconvenience. This should be fixed in the 3.0.6 and 3.1 snapshots. Feel free to give them a try!
odrotbohm
No branches or pull requests
Before 3.0.5 the following was working for reactive before save callbacks:
Then it could be defined as a bean like this:
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:
The text was updated successfully, but these errors were encountered: