Git Product home page Git Product logo

Comments (6)

mp911de avatar mp911de commented on April 28, 2024

BeforeSaveCallback is called after transforming the object into a Statement (that's also why you get the Statement object). Before save is useful if you want to save a certain state to the database but you want to render a different object state after the save.

What you're looking for is ReactiveBeforeConvertCallback.

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.

from spring-data-cassandra.

amazingstream avatar amazingstream commented on April 28, 2024

Thanks for the quick response. Changing ReactiveBeforeSaveCallback to ReactiveBeforeConvertCallback worked for me.

from spring-data-cassandra.

amazingstream avatar amazingstream commented on April 28, 2024

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?

from spring-data-cassandra.

mp911de avatar mp911de commented on April 28, 2024

ReactiveAfterConvertCallback isn't available as the entity row mapper doesn't expose a reactive mapping interface. Also, bulk-loading entities and creating Mono's creates a lot of GC pressure so we initially didn't want to expose a reactive AfterLoad/AfterConvert callback.

from spring-data-cassandra.

amazingstream avatar amazingstream commented on April 28, 2024

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")
public class TestTableClass{

@ValueConverter(..class)

from spring-data-cassandra.

mp911de avatar mp911de commented on April 28, 2024

Thanks for bringing @ValueConverter up. It isn't supported yet and I created #1449 to keep track of the progress.

from spring-data-cassandra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.