Using Apache Cassandra templates
We may want to access our data hosted in Cassandra in a more flexible way than the one provided by CassandraRepository
. For instance, we may want to retrieve data from our comments system using a dynamic or complex query, execute operations in batch, or access a low-level feature. In those cases, it is more convenient to use a Cassandra template as it provides more low-level access to Cassandra’s features.
In this recipe, we will implement functionality that will dynamically search comments using different parameters, such as a date range, tags, and so on. For that, we’ll use Cassandra templates.
Getting ready
We will use the same tools that we did in the Connecting your application to Apache Cassandra recipe – that is, Docker and Apache Cassandra.
To complete this recipe, you’ll need the project you created for the Using Testcontainers with Cassandra recipe. If you haven’t completed that recipe yet, don...