p_a_ll_a_b
p_a_ll_a_b

Reputation: 183

Cassandra SimpleStatement protected constructor

I am using DataStax Java driver 3.0.0-alpha4 for cassandra with Scala. The following doesn't compile :

object Test {
 def get = {
   val stmt = new SimpleStatement("query")
   CassandraConnector.session.execute(stmt)
 }
}

The error I get is :

Access to protected constructor SimpleStatement not permitted because [error] enclosing object Test in package cassandra is not a subclass of [error] class SimpleStatement in package core where target is defined

However using BoundStatement or PreparedStatement works fine.

Upvotes: 1

Views: 122

Answers (1)

doanduyhai
doanduyhai

Reputation: 8812

Issue solve in Java driver 3.0.0-rc1, the public constructor is back

For earlier 3.0.0-x versions, use session.newSimpleStatement(codecRegistry, protocolVersion)

Upvotes: 4

Related Questions