1
votes

I was working on a project and couldn't help but notice that it uses two different execute methods to trigger a query execution:

1> session.execute()
2> cassandraTemplate.execute()

Could someone please explain the difference between the two?

Thanks!

1
Looking at the code of CqlTemplate, it seems that it uses the session object itself to execute the query!Kumar Kavish

1 Answers

1
votes

You're confusing 2 things: session.execute is the method from DataStax Java driver that execute raw CQL string or statements. The cassandraTemplate.execute is the method from the Spring Data for Apache Cassandra that wraps DataStax Java driver and adds more functionality for better Spring integration - under the hood it uses session.execute.