-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
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
ReactiveBeforeSaveCallback
not documented properly
#1448
Comments
What you're looking for is Looking at the documentation, the docs of events and callbacks could be a bit more descriptive and so I'm converting this ticket into a documentation ticket. |
ReactiveBeforeSaveCallback
not documented properly
Thanks for the quick response. Changing ReactiveBeforeSaveCallback to ReactiveBeforeConvertCallback worked for me. |
why is ReactiveAfterConvertCallback or afterLoadCallback not available? I am able to transform the entity before persisting using ReactiveBeforeConvertCallback but I have to transform again after reading from the database. Should I be using a different interface? |
|
I see. Initially, I implemented PropertyValueConverter and added @ValueConverter to a property before persisting. But that is also not getting invoked. I understand @ValueConverter is part of spring data and I am using Spring data reactive cassandra. @table("tablename") @ValueConverter(..class) |
Thanks for bringing |
ReactiveBeforeSaveCallback is not persisting the transformed object to the database but the save method returns the transformed object.
I am using version 3.4.16. I implemented ReactiveBeforeSaveCallback like this...
import org.springframework.data.cassandra.core.mapping.event.ReactiveBeforeSaveCallback;
import reactor.core.publisher.Mono;
public class CustomReactiveBeforeSaveCallback implements ReactiveBeforeSaveCallback {
}
MyType n = new MyType();
n.setColumnValue("ORIGINAL");
I am calling the save method like this.
Mono saved = reactiveEntityRepository.save(n);
saved.subscribe(s ->
System.out.println(s.columnValue); //returns CHANGED VALUE but the database has ORIGINAL
);
saved.columnValue has "CHANGED VALUE". But the database still has "ORIGINAL". I was expecting the database to persist the transformed value. I can see that the before save method is being invoked but the updated value is not being stored to the database.
The text was updated successfully, but these errors were encountered: