spring-projects / spring-data-cassandra

Provides support to increase developer productivity in Java when using Apache Cassandra. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-cassandra/
Apache License 2.0
373 stars 307 forks source link

Documentation is out of date #1474

Closed spartanhooah closed 5 months ago

spartanhooah commented 5 months ago

The documentation for INSERT, UPDATE, and DELETE has a varargs version of ReactiveCassandraTemplate#execute, but according to the Javadoc there is only one version of that method and it takes a com.datastax.oss.driver.api.core.cql.Statement.

mp911de commented 5 months ago

Not quite sure what you're referring to as ReactiveCqlOperations declares execute(String cql, Object... args) on its interface. Most CqlTemplate methods define overloads accepting either Statement or CQL with a varargs parameter for CQL arguments.

spartanhooah commented 5 months ago

Ah, I think I see my misunderstanding. I thought ReactiveCassandraTemplate was related to ReactiveCqlTemplate, but that's evidently not the case. I think I was jumping between the "Persisting Entities" and "CQL Template API" sections and didn't realize they use different classes/interfaces for their examples. Is there an explanation of when one would want to use the CQL vs. Cassandra templates that I overlooked?

mp911de commented 5 months ago

Thanks for sharing your thoughts. There's indeed a separation between CQL and entity-oriented operations. The CQL Template provides a foundation for CQL-centric operations, similar to Spring's JdbcTemplate while the CassandraTemplate is entity-centric.

We had in an older iteration of the documentation a chapter providing guidance on CqlTemplate vs CassandraTemplate. The current documentation is missing these snippets, however we reinstated the documentation via #1475.